public function PagerPluginBase::executeCountQuery

Execute the count query, which will be done just prior to the query itself being executed.

1 method overrides PagerPluginBase::executeCountQuery()
None::executeCountQuery in drupal/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php
Execute the count query, which will be done just prior to the query itself being executed.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php, line 180
Definition of Drupal\views\Plugin\views\pager\PagerPluginBase.

Class

PagerPluginBase
The base plugin to handle pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function executeCountQuery(&$count_query) {
  $this->total_items = $count_query
    ->execute()
    ->fetchField();
  if (!empty($this->options['offset'])) {
    $this->total_items -= $this->options['offset'];
  }
  $this
    ->updatePageInfo();
  return $this->total_items;
}