function QueryBase::pager
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::pager()
- 10 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::pager()
- 11.x core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::pager()
Overrides QueryInterface::pager
File
-
core/
lib/ Drupal/ Core/ Entity/ Query/ QueryBase.php, line 288
Class
- QueryBase
- The base entity query class.
Namespace
Drupal\Core\Entity\QueryCode
public function pager($limit = 10, $element = NULL) {
// Even when not using SQL, storing the element PagerSelectExtender is as
// good as anywhere else.
if (!isset($element)) {
$element = PagerSelectExtender::$maxElement++;
}
elseif ($element >= PagerSelectExtender::$maxElement) {
PagerSelectExtender::$maxElement = $element + 1;
}
$this->pager = [
'limit' => $limit,
'element' => $element,
];
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.