1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 21:58:10 +02:00

DibiResult: fetchAssoc refactoring

This commit is contained in:
David Grudl
2009-10-06 16:51:27 +02:00
parent d68e526381
commit 0337cbdba9

View File

@@ -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;
} }