function PagerPluginBase::execute_count_query

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

1 method overrides PagerPluginBase::execute_count_query()
None::execute_count_query 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 167
Definition of Drupal\views\Plugin\views\pager\PagerPluginBase.

Class

PagerPluginBase
The base plugin to handle pager.

Namespace

Drupal\views\Plugin\views\pager

Code

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