From 330c66559cdf1f1d03695811bb8e56d8219442ee Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 21 Jan 2014 10:54:13 +0100 Subject: [PATCH 1/2] Improved DQL's "new" operator documentation I had to dig through the pull requests and issues to figure that out, so I believe it's best documented explicitly. --- docs/en/reference/dql-doctrine-query-language.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index 6d78482dc..44094e255 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -509,6 +509,8 @@ And then use the ``NEW`` DQL keyword : $query = $em->createQuery('SELECT NEW CustomerDTO(c.name, e.email, a.city, SUM(o.value)) FROM Customer c JOIN c.email e JOIN c.address a JOIN c.orders o GROUP BY c'); $users = $query->getResult(); // array of CustomerDTO +Note that you cannot pass entities as constructor parameters for now. + Using INDEX BY ~~~~~~~~~~~~~~ From 30c3eb0465ff7fe3c1d60415b41b2df632ec1426 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 21 Jan 2014 17:34:54 +0100 Subject: [PATCH 2/2] Improved DQL's "new" operator documentation --- docs/en/reference/dql-doctrine-query-language.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index 44094e255..06aaa58ab 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -509,7 +509,7 @@ And then use the ``NEW`` DQL keyword : $query = $em->createQuery('SELECT NEW CustomerDTO(c.name, e.email, a.city, SUM(o.value)) FROM Customer c JOIN c.email e JOIN c.address a JOIN c.orders o GROUP BY c'); $users = $query->getResult(); // array of CustomerDTO -Note that you cannot pass entities as constructor parameters for now. +Note that you can only pass scalar expressions to the constructor. Using INDEX BY ~~~~~~~~~~~~~~