From 2a5b18d17d55ec8b0c1d0ed22b0f0a3f72147cd6 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 8 Jun 2013 19:35:08 +0300 Subject: [PATCH] simplify SqlProfiler --- ipf/orm/connection.php | 2 +- ipf/orm/connection/profiler.php | 65 +++------------------------------ 2 files changed, 6 insertions(+), 61 deletions(-) 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 -- 2.49.0