You are here

protected function RestfulDataProviderVariable::applyListPagination in RESTful 7

Set correct page for the index within the array of variables.

Determine the page that should be seen. Page 1 is actually index 0.

Parameters

array $variables: An array keyed by variable name, valued by unserialized variable value.

Throws

\RestfulBadRequestException

1 call to RestfulDataProviderVariable::applyListPagination()
RestfulDataProviderVariable::getVariablesForList in plugins/restful/RestfulDataProviderVariable.php

File

plugins/restful/RestfulDataProviderVariable.php, line 83
Contains \RestfulDataProviderDbQuery

Class

RestfulDataProviderVariable
@file Contains \RestfulDataProviderDbQuery

Code

protected function applyListPagination(array &$variables) {
  list($offset, $range) = $this
    ->parseRequestForListPagination();
  $variables = array_slice($variables, $offset, $range);
}