Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PagerPluginBase.php

function PagerPluginBase::executeCountQuery

Executes the count query.

This will be done just prior to the query itself being executed.

1 method overrides PagerPluginBase::executeCountQuery()
None::executeCountQuery in core/modules/views/src/Plugin/views/pager/None.php
Executes the count query.

File

core/modules/views/src/Plugin/views/pager/PagerPluginBase.php, line 191

Class

PagerPluginBase
Base class for views pager plugins.

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'];
    }
    // Prevent from being negative.
    $this->total_items = max(0, $this->total_items);
    return $this->total_items;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal