- Patch #1266694 by Damien Tournoud: Fixed DatabaseStatementPrefetch doesn't implement fetchColumn().

8.0.x
Dries Buytaert 2011-09-11 13:00:50 -04:00
parent 168c1364ab
commit eeac53e45f
1 changed files with 5 additions and 1 deletions

View File

@ -370,7 +370,7 @@ class DatabaseStatementPrefetch implements Iterator, DatabaseStatementInterface
}
}
public function fetchField($index = 0) {
public function fetchColumn($index = 0) {
if (isset($this->currentRow) && isset($this->columnNames[$index])) {
// We grab the value directly from $this->data, and format it.
$return = $this->currentRow[$this->columnNames[$index]];
@ -382,6 +382,10 @@ class DatabaseStatementPrefetch implements Iterator, DatabaseStatementInterface
}
}
public function fetchField($index = 0) {
return $this->fetchColumn($index);
}
public function fetchObject($class_name = NULL, $constructor_args = array()) {
if (isset($this->currentRow)) {
if (!isset($class_name)) {