Skip to content

Commit 01b1706

Browse files
toby-griffithsalanpoulain
authored andcommitted
Details of paginators for customer data providers
This explains the need for paginators when using custom data providers, and the available paginators.
1 parent b324225 commit 01b1706

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/pagination.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,15 @@ class BookRepository extends ServiceEntityRepository
542542
}
543543
}
544544
```
545+
546+
## Pagination for Customer Data Providers
547+
548+
If you're using a customer Data Providers, and not the Doctrine ORM, ODM or
549+
ElasticSearch provides, then if you want your results to be paginated then
550+
you'll need to return an instance of a
551+
`\ApiPlatform\Core\DataProvider\PartialPaginatorInterface` or
552+
`\ApiPlatform\Core\DataProvider\PaginatorInterface`. A few existing classes are
553+
provided to get you started with these…
554+
555+
* `\ApiPlatform\Core\DataProvider\ArrayPaginator`
556+
* `\ApiPlatform\Core\DataProvider\TraversablePaginator`

0 commit comments

Comments
 (0)