public function Mini::postExecute

Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::postExecute().

Overrides PagerPluginBase::postExecute

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/pager/Mini.php, line 79
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 postExecute(&$result) {

  // In query() one more item might have been retrieved than necessary. If so,
  // the next link needs to be displayed and the item removed.
  if (count($result) > $this
    ->getItemsPerPage()) {
    array_pop($result);

    // Make sure the pager shows the next link by setting the total items to
    // the biggest possible number but prevent failing calculations like
    // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
    pager_default_initialize(PHP_INT_MAX / 2, $this
      ->getItemsPerPage(), $this->options['id']);
  }
}