You are here

protected function RestfulDataProviderDbQuery::queryForListPagination in RESTful 7

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

\RestfulBadRequestException

See also

\RestfulEntityBase::getQueryForList

1 call to RestfulDataProviderDbQuery::queryForListPagination()
RestfulDataProviderDbQuery::getQueryForList in plugins/restful/RestfulDataProviderDbQuery.php
Prepare a query for RestfulEntityBase::getList().

File

plugins/restful/RestfulDataProviderDbQuery.php, line 236
Contains \RestfulDataProviderDbQuery

Class

RestfulDataProviderDbQuery
@file Contains \RestfulDataProviderDbQuery

Code

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