Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added yml example in ordered-associations.rst #641

Merged
merged 1 commit into from

3 participants

@bksunday

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

@bksunday bksunday 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

@Ocramius Ocramius merged commit edca8c8 into doctrine:master
@bksunday bksunday deleted the bksunday:patch-1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 3, 2013
  1. @bksunday

    Added yml example in ordered-associations.rst

    bksunday authored
    And modified it to be in a configuration-block instead of separate code-block
This page is out of date. Refresh to see the latest.
Showing with 45 additions and 26 deletions.
  1. +45 −26 docs/en/tutorials/ordered-associations.rst
View
71 docs/en/tutorials/ordered-associations.rst
@@ -12,32 +12,51 @@ collection.
Additional to any ``@OneToMany`` or ``@ManyToMany`` annotation you
can specify the ``@OrderBy`` in the following way:
-.. code-block:: php
-
- <?php
- /** @Entity **/
- class User
- {
- // ...
-
- /**
- * @ManyToMany(targetEntity="Group")
- * @OrderBy({"name" = "ASC"})
- **/
- private $groups;
- }
-
-.. code-block:: xml
-
- <doctrine-mapping>
- <entity name="User">
- <many-to-many field="groups" target-entity="Group">
- <order-by>
- <order-by-field name="name" direction="ASC" />
- </order-by>
- </many-to-many>
- </entity>
- </doctrine-mapping>
+.. configuration-block::
+
+ .. code-block:: php
+
+ <?php
+ /** @Entity **/
+ class User
+ {
+ // ...
+
+ /**
+ * @ManyToMany(targetEntity="Group")
+ * @OrderBy({"name" = "ASC"})
+ **/
+ private $groups;
+ }
+
+ .. code-block:: xml
+
+ <doctrine-mapping>
+ <entity name="User">
+ <many-to-many field="groups" target-entity="Group">
+ <order-by>
+ <order-by-field name="name" direction="ASC" />
+ </order-by>
+ </many-to-many>
+ </entity>
+ </doctrine-mapping>
+
+ .. code-block:: yaml
+
+ User:
+ type: entity
+ manyToMany:
+ groups:
+ orderBy: { 'name': 'ASC' }
+ targetEntity: Group
+ joinTable:
+ name: users_groups
+ joinColumns:
+ user_id:
+ referencedColumnName: id
+ inverseJoinColumns:
+ group_id:
+ referencedColumnName: id
The DQL Snippet in OrderBy is only allowed to consist of
unqualified, unquoted field names and of an optional ASC/DESC
Something went wrong with that request. Please try again.