You are here

protected function views_php_plugin_pager::update_wrapped_pager in Views PHP 7.2

1 call to views_php_plugin_pager::update_wrapped_pager()
views_php_plugin_pager::pre_render in plugins/views/views_php_plugin_pager.inc

File

plugins/views/views_php_plugin_pager.inc, line 54

Class

views_php_plugin_pager
A (fake) pager plugin that wraps around the actual pager.

Code

protected function update_wrapped_pager() {
  $this->wrapped->total_items = count($this->wrapped->view->result);
  $this->wrapped
    ->update_page_info();
  $item_per_page = $this->wrapped
    ->get_items_per_page();
  if ($item_per_page > 0) {
    $offset = $this->wrapped
      ->get_current_page() * $item_per_page + $this->wrapped
      ->get_offset();
    $this->wrapped->view->result = array_slice($this->wrapped->view->result, $offset, $item_per_page);
  }
}