From 0337cbdba943fb026700b5af7a1dbd7ab2b91b1d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 6 Oct 2009 16:51:27 +0200 Subject: [PATCH] DibiResult: fetchAssoc refactoring --- dibi/libs/DibiResult.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index 27ecdea3..dca12f76 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -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; }