public function PagerSelectExtender::element in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::element()
- 9 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::element()
Specify the element ID for this pager query.
The element is used to differentiate different pager queries on the same page so that they may be operated independently. If you do not specify an element, every pager query on the page will get a unique element. If for whatever reason you want to explicitly define an element for a given query, you may do so here.
Note that no collision detection is done when setting an element ID explicitly, so it is possible for two pagers to end up using the same ID if both are set explicitly.
Parameters
$element: Element ID that is used to differentiate different pager queries.
1 call to PagerSelectExtender::element()
- PagerSelectExtender::ensureElement in core/
lib/ Drupal/ Core/ Database/ Query/ PagerSelectExtender.php - Ensure that there is an element associated with this query.
File
- core/
lib/ Drupal/ Core/ Database/ Query/ PagerSelectExtender.php, line 158
Class
- PagerSelectExtender
- Query extender for pager queries.
Namespace
Drupal\Core\Database\QueryCode
public function element($element) {
$this->element = $element;
$this->connection
->getPagerManager()
->reservePagerElementId($this->element);
return $this;
}