You are here

public function StatementPrefetch::next in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::next()
  2. 9 core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::next()
9 calls to StatementPrefetch::next()
StatementPrefetch::execute in core/lib/Drupal/Core/Database/StatementPrefetch.php
Executes a prepared statement.
StatementPrefetch::fetch in core/lib/Drupal/Core/Database/StatementPrefetch.php
Fetches the next row from a result set.
StatementPrefetch::fetchAll in core/lib/Drupal/Core/Database/StatementPrefetch.php
Returns an array containing all of the result set rows.
StatementPrefetch::fetchAllAssoc in core/lib/Drupal/Core/Database/StatementPrefetch.php
Returns the result set as an associative array keyed by the given field.
StatementPrefetch::fetchAllKeyed in core/lib/Drupal/Core/Database/StatementPrefetch.php
Returns the entire result set as a single associative array.

... See full list

File

core/lib/Drupal/Core/Database/StatementPrefetch.php, line 371

Class

StatementPrefetch
An implementation of StatementInterface that prefetches all data.

Namespace

Drupal\Core\Database

Code

public function next() {
  if (!empty($this->data)) {
    $this->currentRow = reset($this->data);
    $this->currentKey = key($this->data);
    unset($this->data[$this->currentKey]);
  }
  else {
    $this->currentRow = NULL;
  }
}