function Mini::postExecute

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/pager/Mini.php \Drupal\views\Plugin\views\pager\Mini::postExecute()
  2. 10 core/modules/views/src/Plugin/views/pager/Mini.php \Drupal\views\Plugin\views\pager\Mini::postExecute()
  3. 11.x core/modules/views/src/Plugin/views/pager/Mini.php \Drupal\views\Plugin\views\pager\Mini::postExecute()

Overrides PagerPluginBase::postExecute

File

core/modules/views/src/Plugin/views/pager/Mini.php, line 74

Class

Mini
The plugin to handle mini pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function postExecute(&$result) {
    // Only modify the result if we didn't do a total row count
    if (!$this->view->get_total_rows) {
        $this->total_items = $this->getCurrentPage() * $this->getItemsPerPage() + count($result);
        // query() checks if we need a next link by setting limit 1 record past
        // this page If we got the extra record we need to remove it before we
        // render the result.
        if ($this->getItemsPerPage() > 0 && count($result) > $this->getItemsPerPage()) {
            array_pop($result);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.