From: Andrey Kutejko Date: Sat, 8 Jun 2013 16:35:08 +0000 (+0300) Subject: simplify SqlProfiler X-Git-Tag: 0.6~123 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=2a5b18d17d55ec8b0c1d0ed22b0f0a3f72147cd6;p=ipf-legacy-orm.git simplify SqlProfiler --- diff --git a/ipf/orm/connection.php b/ipf/orm/connection.php index ce37457..0d161a0 100644 --- a/ipf/orm/connection.php +++ b/ipf/orm/connection.php @@ -853,7 +853,7 @@ abstract class IPF_ORM_Connection extends IPF_ORM_Configurable implements Counta public function notifyDBListeners($method, $event) { foreach ($this->dbListeners as $listener) - if (method_exists($listener, $method)) + if (is_callable(array($listener, $method))) $listener->$method($event); } } diff --git a/ipf/orm/connection/profiler.php b/ipf/orm/connection/profiler.php index 6230025..4284fcb 100644 --- a/ipf/orm/connection/profiler.php +++ b/ipf/orm/connection/profiler.php @@ -1,6 +1,6 @@ end(); } - /** - * If filtering by query type is enabled, only keep the query if - * it was one of the allowed types. - */ - /* - if ( !is_null($this->filterTypes)) { - if ( ! ($a[0]->getQueryType() & $this->_filterTypes)) { - - } - } - */ - } - - public function get($key) - { - if (isset($this->events[$key])) { - return $this->events[$key]; - } - return null; - } - - public function getAll() - { - return $this->events; } +} - public function getIterator() - { - return new ArrayIterator($this->events); - } - - public function count() - { - return count($this->events); - } - - public function pop() - { - return array_pop($this->events); - } - - public function lastEvent() - { - if (empty($this->events)) { - return false; - } - - end($this->events); - return current($this->events); - } -} \ No newline at end of file