1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 23:26:49 +02:00

added DibiRow::toArray() & Countable

This commit is contained in:
David Grudl
2010-04-26 20:44:17 +02:00
parent 26384626ba
commit 5d95f0ba0d
2 changed files with 20 additions and 6 deletions

View File

@@ -398,7 +398,7 @@ class DibiResult extends DibiObject implements IDataSource
} elseif ($as === '=') { // "record" node
if ($x === NULL) {
$x = (array) $row;
$x = $row->toArray();
$x = & $x[ $assoc[$i+1] ];
$x = NULL; // prepare child node
} else {
@@ -422,7 +422,7 @@ class DibiResult extends DibiObject implements IDataSource
if ($x === NULL) { // build leaf
if ($leaf === '=') {
$x = (array) $row;
$x = $row->toArray();
} else {
$x = $row;
}
@@ -457,7 +457,7 @@ class DibiResult extends DibiObject implements IDataSource
}
// autodetect
$tmp = array_keys((array) $row);
$tmp = array_keys($row->toArray());
$key = $tmp[0];
if (count($row) < 2) { // indexed-array
do {