mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 05:37:39 +02:00
DibiResult: fetchAssoc refactoring
This commit is contained in:
@@ -330,7 +330,6 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
|
||||
// make associative tree
|
||||
do {
|
||||
$arr = (array) $row;
|
||||
$x = & $data;
|
||||
|
||||
// iterative deepening
|
||||
@@ -340,7 +339,7 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
|
||||
} elseif ($as === '=') { // "record" node
|
||||
if ($x === NULL) {
|
||||
$x = $arr;
|
||||
$x = (array) $row;
|
||||
$x = & $x[ $assoc[$i+1] ];
|
||||
$x = NULL; // prepare child node
|
||||
} else {
|
||||
@@ -358,13 +357,13 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
|
||||
|
||||
} else { // associative-array node
|
||||
$x = & $x[ $arr[ $as ] ];
|
||||
$x = & $x[$row->$as];
|
||||
}
|
||||
}
|
||||
|
||||
if ($x === NULL) { // build leaf
|
||||
if ($leaf === '=') {
|
||||
$x = $arr;
|
||||
$x = (array) $row;
|
||||
} else {
|
||||
$x = $row;
|
||||
}
|
||||
|
Reference in New Issue
Block a user