That part about the paginator is important information for us!

When passing a query to the paginator, the paginator will (by default) perform 
2 queries:
- one to fetch _all_ ids of the root entities.
- one to fetch a single page (based on those root ids).

This is needed to deal with queries containing JOIN clauses.

When you join tables `a` and `b`, and limit on say 5 rows, those rows could 
contain the following:

a.id | b.id
-----+-----
   1 |    1
   1 |    2
   1 |    3
   2 |    4
   3 |    5

Doctrine will hydrate this into entities, which will result in an array with 
only 3 _root_ entities. So you don't get an array with 5 entities you would 
expect (when telling the paginator to limit on 5 entities).

PS: You could turn this behaviour off by passing FALSE as second argument to 
the paginator. But be ware that you should only do this when the query 
_doesn't_ contain JOIN clauses!

--  
Jasper N. Brouwer
(@jaspernbrouwer)


On 11 June 2014 at 16:03:50, [email protected] ([email protected]) wrote:
> What var_dump($query->getDQL()) output (before I give my query to a
> Doctrine paginator) :
>  
> SELECT
> > partial VARIABLE_PROFIL.{idProfil},
> > partial VARIABLE.{idVariable,mnemonique,libelle,varSaep}
> > FROM
> > Acme\AdminBundle\Entity\Variable VARIABLE
> > LEFT JOIN VARIABLE.idProfil VARIABLE_PROFIL
> > ORDER BY VARIABLE.libelle asc


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to