From b400ad52ccacd253b4975ff5d67c63e5342b5180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Perrin?= Date: Tue, 27 May 2014 11:43:15 +0200 Subject: [PATCH] Add documentation for the `HIDDEN` keyword in DQL --- docs/en/reference/dql-doctrine-query-language.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index aacd4d89b..e8348350e 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -302,6 +302,14 @@ With Arithmetic Expression in WHERE clause: $query = $em->createQuery('SELECT u FROM CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000'); $users = $query->getResult(); // array of ForumUser objects +Retrieve user entities with Arithmetic Expression in ORDER close, using the ``HIDDEN`` keyword: + +.. code-block:: php + + createQuery('SELECT u, u.posts_count + u.likes_count AS HIDDEN score FROM CmsUser u ORDER BY score'); + $users = $query->getResult(); // array of User objects + Using a LEFT JOIN to hydrate all user-ids and optionally associated article-ids: