You are here

protected function DataProviderEntity::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

\EntityFieldQuery $query: The query object.

Throws

BadRequestException

See also

\RestfulEntityBase::getQueryForList

1 call to DataProviderEntity::queryForListPagination()
DataProviderEntity::getQueryForList in src/Plugin/resource/DataProvider/DataProviderEntity.php
Prepare a query for RestfulEntityBase::getList().

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 820
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

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