You are here

private function IndexResource::getPagination in JSON:API Search API 8

Get pagination for the request.

Parameters

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

Return value

\Drupal\jsonapi\Query\OffsetPage The pagination object.

1 call to IndexResource::getPagination()
IndexResource::process in src/Resource/IndexResource.php
Process the resource request.

File

src/Resource/IndexResource.php, line 198

Class

IndexResource
JSON:API Resource to return Search API index results.

Namespace

Drupal\jsonapi_search_api\Resource

Code

private function getPagination(Request $request) : OffsetPage {
  return $request->query
    ->has('page') ? OffsetPage::createFromQueryParameter($request->query
    ->get('page')) : new OffsetPage(OffsetPage::DEFAULT_OFFSET, OffsetPage::SIZE_MAX);
}