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:
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.
Since 2.7 API Platform supports custom pagination aka pagination for custom state providers.
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.