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