return $i;
} else {
$i = DB_DataObject::factory($cls);
- if (empty($i)) {
+ if (empty($i) || PEAR::isError($i)) {
return false;
}
foreach ($kv as $k => $v) {
}
$start = microtime(true);
- $result = parent::_query($string);
+ $result = null;
+ if (Event::handle('StartDBQuery', array($this, $string, &$result))) {
+ $result = parent::_query($string);
+ Event::handle('EndDBQuery', array($this, $string, &$result));
+ }
$delta = microtime(true) - $start;
$limit = common_config('db', 'log_slow_queries');