You are here

protected function EntityQueryResourceBase::getPaginatorForRequest in JSON:API Resources 8

Gets an entity query paginator for the current request.

Currently, this will always returns an OffsetLimitPaginator, but it's possible that it may return other paginator types in the future. Such as a cursor-based paginator.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

\Drupal\jsonapi_resources\Entity\Query\PaginatorInterface A paginator for the request.

2 calls to EntityQueryResourceBase::getPaginatorForRequest()
AuthorArticles::process in tests/modules/jsonapi_resources_test/src/Resource/AuthorArticles.php
Process the resource request.
FeaturedNodes::process in tests/modules/jsonapi_resources_test/src/Resource/FeaturedNodes.php
Process the resource request.

File

src/Resource/EntityQueryResourceBase.php, line 65

Class

EntityQueryResourceBase
Defines basic functionality for an entity query-oriented JSON:API Resource.

Namespace

Drupal\jsonapi_resources\Resource

Code

protected function getPaginatorForRequest(Request $request) : PaginatorInterface {
  return OffsetLimitPaginator::create($request, $this->entityQueryExecutor);
}