public function value($ColumnName, $DefaultValue = null)
{
if ($Row = $this->nextRow()) {
if (is_array($ColumnName)) {
$Result = array();
foreach ($ColumnName as $Name => $Default) {
if (is_object($Row) && property_exists($Row, $Name)) {
return $Row->{$Name};
} elseif (is_array($Row) && array_key_exists($Name, $Row)) {
return $Row[$Name];
} else {
$Result[] = $Default;
}
}
return $Result;
} else {
if (is_object($Row) && property_exists($Row, $ColumnName)) {
return $Row->{$ColumnName};
} elseif (is_array($Row) && array_key_exists($ColumnName, $Row)) {
return $Row[$ColumnName];
}
}
}
if (is_array($ColumnName)) {
return array_values($ColumnName);
}
return $DefaultValue;
}