mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #298] [MERGED] Pagination using SQL walkers #7996
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/298
Author: @sandermarechal
Created: 3/6/2012
Status: ✅ Merged
Merged: 3/12/2012
Merged by: @beberlei
Base:
master← Head:paginate-sql-walkers📝 Commits (8)
edd5d14Pagination using SQL walkersd2501a9Throw exception when using the CountWalker with a HAVING query2f817b3Use a dataProvider to test both TreeWalker and SqlWalker paginationc9d962bFix indentationad871e8Cleaned upusestatements47964a1UseassertCountfor simpler tests53ff312Renamed *SqlWalker to *OutputWalker43f97a9CountOutputWalker does not need CountWalker::HINT_DISTINCT📊 Changes
10 files changed (+531 additions, -64 deletions)
View changed files
➕
lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php(+120 -0)📝
lib/Doctrine/ORM/Tools/Pagination/CountWalker.php(+4 -0)➕
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php(+144 -0)📝
lib/Doctrine/ORM/Tools/Pagination/Paginator.php(+65 -12)📝
tests/Doctrine/Tests/ORM/Functional/PaginationTest.php(+76 -24)➕
tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php(+45 -0)📝
tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php(+26 -10)➕
tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php(+33 -0)📝
tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php(+4 -4)📝
tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php(+14 -14)📄 Description
A CountSqlWalker and LimitSubquerySqlWalker have been implemented. By
default the Paginator will use these SQL walkers. When a query already
uses custom SQL walkers, the Paginator will fall back to the existing
TreeWalker implementations. 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 entities with composite primary keys in the CountSqlWalker
and LimitSubquerySqlWalker. 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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.