You are here

public function views_php_plugin_pager::pre_execute in Views PHP 7.2

Same name and namespace in other branches
  1. 7 plugins/views/views_php_plugin_pager.inc \views_php_plugin_pager::pre_execute()

Perform any needed actions just prior to the query executing.

File

plugins/views/views_php_plugin_pager.inc, line 13

Class

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

Code

public function pre_execute($query) {
  $this->wrapped
    ->pre_execute($query);
  foreach (array(
    /*'argument',*/
    'field',
    'filter',
    'sort',
  ) as $type) {
    foreach ($this->wrapped->view->{$type} as $id => $handler) {
      if (is_callable(array(
        $handler,
        'php_pre_execute',
      ))) {
        $handler
          ->php_pre_execute();
      }
    }
  }
  $this->wrapped->view->query
    ->set_limit(0);
  $this->wrapped->view->query
    ->set_offset(0);
}