Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Added yml example in ordered-associations.rst #641

Merged
merged 1 commit into from about 1 year ago

3 participants

Anthony doctrinebot Marco Pivetta
Anthony

Added missing yaml example of ordered-associations, and put php, xml and yml codes into a configuration-block instead of separate code-blocks

Anthony Added yml example in ordered-associations.rst
And modified it to be in a configuration-block instead of separate code-block
1278b79
doctrinebot
Collaborator

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2386

Marco Pivetta Ocramius merged commit edca8c8 into from April 03, 2013
Marco Pivetta Ocramius closed this April 03, 2013
Anthony bksunday deleted the branch April 03, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 03, 2013
Anthony Added yml example in ordered-associations.rst
And modified it to be in a configuration-block instead of separate code-block
1278b79
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 45 additions and 26 deletions. Show diff stats Hide diff stats

  1. 71  docs/en/tutorials/ordered-associations.rst
71  docs/en/tutorials/ordered-associations.rst
Source Rendered
@@ -12,32 +12,51 @@ collection.
12 12
 Additional to any ``@OneToMany`` or ``@ManyToMany`` annotation you
13 13
 can specify the ``@OrderBy`` in the following way:
14 14
 
15  
-.. code-block:: php
16  
-
17  
-    <?php
18  
-    /** @Entity **/
19  
-    class User
20  
-    {
21  
-        // ...
22  
-    
23  
-        /**
24  
-         * @ManyToMany(targetEntity="Group")
25  
-         * @OrderBy({"name" = "ASC"})
26  
-         **/
27  
-        private $groups;
28  
-    }
29  
-
30  
-.. code-block:: xml
31  
-
32  
-    <doctrine-mapping>
33  
-        <entity name="User">
34  
-            <many-to-many field="groups" target-entity="Group">
35  
-                <order-by>
36  
-                    <order-by-field name="name" direction="ASC" />
37  
-                </order-by>
38  
-            </many-to-many>
39  
-        </entity>
40  
-    </doctrine-mapping>
  15
+.. configuration-block::
  16
+
  17
+    .. code-block:: php
  18
+
  19
+        <?php
  20
+        /** @Entity **/
  21
+        class User
  22
+        {
  23
+            // ...
  24
+        
  25
+            /**
  26
+             * @ManyToMany(targetEntity="Group")
  27
+             * @OrderBy({"name" = "ASC"})
  28
+             **/
  29
+            private $groups;
  30
+        }
  31
+
  32
+    .. code-block:: xml
  33
+
  34
+        <doctrine-mapping>
  35
+            <entity name="User">
  36
+                <many-to-many field="groups" target-entity="Group">
  37
+                    <order-by>
  38
+                        <order-by-field name="name" direction="ASC" />
  39
+                    </order-by>
  40
+                </many-to-many>
  41
+            </entity>
  42
+        </doctrine-mapping>
  43
+
  44
+    .. code-block:: yaml
  45
+
  46
+        User:
  47
+          type: entity
  48
+          manyToMany:
  49
+            groups:
  50
+              orderBy: { 'name': 'ASC' }
  51
+              targetEntity: Group
  52
+              joinTable:
  53
+                name: users_groups
  54
+                joinColumns:
  55
+                  user_id:
  56
+                    referencedColumnName: id
  57
+                inverseJoinColumns:
  58
+                  group_id:
  59
+                    referencedColumnName: id
41 60
 
42 61
 The DQL Snippet in OrderBy is only allowed to consist of
43 62
 unqualified, unquoted field names and of an optional ASC/DESC
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.