This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Commit 303dad2
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- src/ResourceGenerator
- test/ResourceGenerator
4 files changed
+1376
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
0 commit comments