You are here

public function ShowMore::executeCountQuery in Views Show More 8

Execute the count query.

Overrides PagerPluginBase::executeCountQuery

File

src/Plugin/views/pager/ShowMore.php, line 328

Class

ShowMore
The plugin to handle show more pager.

Namespace

Drupal\views_show_more\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;
}