You are here

protected function PagerSelectExtender::ensureElement in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::ensureElement()
  2. 10 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::ensureElement()

Ensure that there is an element associated with this query. If an element was not specified previously, then the value of the $maxElement counter is taken, after which the counter is incremented.

After running this method, access $this->element to get the element for this query.

1 call to PagerSelectExtender::ensureElement()
PagerSelectExtender::execute in core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php
Override the execute method.

File

core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php, line 93

Class

PagerSelectExtender
Query extender for pager queries.

Namespace

Drupal\Core\Database\Query

Code

protected function ensureElement() {
  if (!isset($this->element)) {
    $this->element = self::$maxElement++;
  }
}