whiteoctober/Pagerfanta — pull request #46 by sandermarechal (2012-01-03 07:33:18+00:00)
Title: Doctrine ORM pagination improvements

A bunch of improvements to the Doctrine ORM pagination.

The CountWalker and LimitSubqueryWalker have been implemented using output walkers instead of tree walkers. The WhereInWalker has been extended. Improvements:

* Support for more complex DQL queries using named mixed results with GROUP BY and HAVING. For example: ```SELECT g, u, COUNT(u.id) AS userCount FROM Entity\Group g LEFT JOIN g.users u GROUP BY g.id HAVING userCount > 0```
* Support for ```WHERE NOT``` queries
* Better performance. The CountWalker and WhereInWalker use subselects. Most databases can cache subqueries individually, so it is possible to reuse the CountWalker result for the LimitSubqueryWalker. To prevent cache misses, the CountWalker no longer strips ORDER BY clauses.
* Support for entities with composite primary keys in the CountWalker and LimitSqlWalker. Only the WhereInWalker still needs to be updated for full composite primary key support. But someone smarter than me needs to look at that and figure out how to build a WHERE IN query that can select rows based on multiple columns.

CC: @Niko-B @pablodip @Seldaek