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

DibiResult: fixed compatibility with new DibiRow

This commit is contained in:
David Grudl
2010-04-26 21:20:10 +02:00
parent 5d95f0ba0d
commit 555e825bb2

View File

@@ -311,7 +311,7 @@ class DibiResult extends DibiObject implements IDataSource
// check columns
foreach ($assoc as $as) {
// offsetExists ignores NULL in PHP 5.2.1, isset() surprisingly NULL accepts
if ($as !== '[]' && $as !== '=' && $as !== '->' && $as !== '|' && !isset($row[$as])) {
if ($as !== '[]' && $as !== '=' && $as !== '->' && $as !== '|' && !property_exists($row, $as)) {
throw new InvalidArgumentException("Unknown column '$as' in associative descriptor.");
}
}
@@ -469,7 +469,7 @@ class DibiResult extends DibiObject implements IDataSource
$value = $tmp[1];
} else {
if (!isset($row[$value])) {
if (!property_exists($row, $value)) {
throw new InvalidArgumentException("Unknown value column '$value'.");
}
@@ -480,7 +480,7 @@ class DibiResult extends DibiObject implements IDataSource
return $data;
}
if (!isset($row[$key])) {
if (!property_exists($row, $key)) {
throw new InvalidArgumentException("Unknown key column '$key'.");
}
}