You are here

public function Mini::postExecute in Drupal 9

Same name and namespace in other branches
  1. 8 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()

Perform any needed actions just after the query executing.

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);
    }
  }
}