public function Mini::postExecute in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/pager/Mini.php \Drupal\views\Plugin\views\pager\Mini::postExecute()
- 9 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\pagerCode
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);
}
}
}