function StatementPrefetch::next

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::next()
  2. 8.9.x core/lib/Drupal/Core/Database/StatementPrefetch.php \Drupal\Core\Database\StatementPrefetch::next()

Attributes

#[\ReturnTypeWillChange]

File

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

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;
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.