mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
ENHANCEMENT Use simplier query syntax for SS3 ORM
This commit is contained in:
parent
6e30463e3e
commit
8152ddce8c
@ -2024,22 +2024,12 @@ class PostgreSQLQuery extends SS_Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function nextRecord() {
|
public function nextRecord() {
|
||||||
// Coalesce rather than replace common fields.
|
if($data = pg_fetch_assoc($this->handle)) {
|
||||||
if($data = pg_fetch_row($this->handle)) {
|
return $data;
|
||||||
foreach($data as $columnIdx => $value) {
|
|
||||||
$columnName = pg_field_name($this->handle, $columnIdx);
|
|
||||||
// $value || !$ouput[$columnName] means that the *last* occurring value is shown
|
|
||||||
// !$ouput[$columnName] means that the *first* occurring value is shown
|
|
||||||
if(isset($value) || !isset($output[$columnName])) {
|
|
||||||
$output[$columnName] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $output;
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user