function StatementBase::fetchField

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/Statement/StatementBase.php \Drupal\Core\Database\Statement\StatementBase::fetchField()

File

core/lib/Drupal/Core/Database/Statement/StatementBase.php, line 299

Class

StatementBase
StatementInterface base implementation.

Namespace

Drupal\Core\Database\Statement

Code

public function fetchField($index = 0) {
  $column = $this->result
    ->fetch(FetchAs::Column, [
    'column' => $index,
  ]);
  if ($column === FALSE) {
    $this->markResultsetFetchingComplete();
    return FALSE;
  }
  $this->setResultsetCurrentRow($column);
  return $column;
}

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