You are here

protected function DataProviderDbQuery::queryForListPagination in RESTful 7.2

Set correct page (i.e. range) for the query for list.

Determine the page that should be seen. Page 1, is actually offset 0 in the query range.

Parameters

\SelectQuery $query: The query object.

Throws

BadRequestException

See also

\RestfulEntityBase::getQueryForList

1 call to DataProviderDbQuery::queryForListPagination()
DataProviderDbQuery::getQueryForList in src/Plugin/resource/DataProvider/DataProviderDbQuery.php

File

src/Plugin/resource/DataProvider/DataProviderDbQuery.php, line 464
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderDbQuery.

Class

DataProviderDbQuery

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

protected function queryForListPagination(\SelectQuery $query) {
  list($range, $offset) = $this
    ->parseRequestForListPagination();
  $query
    ->range($range, $offset);
}