Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 303dad2

Browse files
committed
feat: Allow Doctrine paginators in collections
This patch adds the method `extractDoctrinePaginator()` to the `ExtractCollectionTrait`, and modifies `extractCollection()` to detect Doctrine paginators and invoke the new method when detected. The method pulls the query from the paginator instance to determine how many results per page are expected, and runs a count against the paginator to determine the total number of records possible. These are then used to create pagination relational links and the various data pieces we inject in the collection resource (total items, total pages, etc.)
1 parent 2bb66fa commit 303dad2

File tree

4 files changed

+1376
-19
lines changed

4 files changed

+1376
-19
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"willdurand/negotiation": "^2.3.1"
3232
},
3333
"require-dev": {
34+
"doctrine/orm": "^2.6",
3435
"phpunit/phpunit": "^7.0.1",
3536
"zendframework/zend-coding-standard": "~1.0.0",
3637
"zendframework/zend-expressive-helpers": "^5.0.0alpha3",

0 commit comments

Comments
 (0)