Skip to content

Add support for API Platform pagination. #12

@b00gizm

Description

@b00gizm

Since 2.7 API Platform supports custom pagination aka pagination for custom state providers.

If you are using custom state providers (not the provided Doctrine ORM, ODM or ElasticSearch ones) and if you want your results to be paginated, you will need to return an instance of a ApiPlatform\State\Pagination\PartialPaginatorInterface or ApiPlatform\State\Pagination\PaginatorInterface. A few existing classes are provided to make it easier to paginate the results:

ApiPlatform\State\Pagination\ArrayPaginator
ApiPlatform\State\Pagination\TraversablePaginator

Their definition is slightly different from the Paginator contract defined in geekcell/php-ddd, which probably calls for an adapter.

Since this is an optional feature and not all users might use API Platform and/or are already on 2.7 or higher, we should accommodate for this fact and avoid conflicts. Here's an example of how Symfony dealt with these kind of situations in the past.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions