From 1278b79c79da6a871ed41c11d97ead14d77ae53a Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 3 Apr 2013 13:31:07 -0300 Subject: [PATCH] Added yml example in ordered-associations.rst And modified it to be in a configuration-block instead of separate code-block --- docs/en/tutorials/ordered-associations.rst | 65 ++++++++++++++-------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/docs/en/tutorials/ordered-associations.rst b/docs/en/tutorials/ordered-associations.rst index e2a48ffcb..121bd145d 100644 --- a/docs/en/tutorials/ordered-associations.rst +++ b/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 +.. configuration-block:: - - - - - - - - - + .. code-block:: xml + + + + + + + + + + + + .. 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