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: