public function Mini::query

Overrides \Drupal\views\Plugin\views\pager\SqlBase::query().

Overrides SqlBase::query

File

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

Class

Mini
The plugin to handle mini pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function query() {
  parent::query();

  // Don't query for the next page if we have a pager that has a limited
  // amount of pages.
  if (empty($this->options['total_pages']) || $this
    ->getCurrentPage() < $this->options['total_pages']) {

    // Increase the items in the query in order to be able to find out whether
    // there is another page.
    $limit = $this->view->query
      ->getLimit();
    $limit += 1;
    $this->view->query
      ->setLimit($limit);
  }
}