From f89987f11f2025fc7b604021c38e85a8cb9f4576 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Fri, 19 Jul 2013 19:32:07 +0300 Subject: [PATCH] remove dead code --- ipf/orm.php | 1 - ipf/orm/configurable.php | 1 - ipf/orm/manager.php | 1 - ipf/orm/query/abstract.php | 55 -------------------------------------- ipf/orm/record.php | 6 ----- 5 files changed, 64 deletions(-) diff --git a/ipf/orm.php b/ipf/orm.php index 78cc0ce..68ac5de 100644 --- a/ipf/orm.php +++ b/ipf/orm.php @@ -137,7 +137,6 @@ final class IPF_ORM const ATTR_MODEL_LOADING = 161; const ATTR_RECURSIVE_MERGE_FIXTURES = 162; const ATTR_SINGULARIZE_IMPORT = 163; - const ATTR_USE_DQL_CALLBACKS = 164; const FETCH_IMMEDIATE = 0; const FETCH_BATCH = 1; diff --git a/ipf/orm/configurable.php b/ipf/orm/configurable.php index 6d448e1..e247be8 100644 --- a/ipf/orm/configurable.php +++ b/ipf/orm/configurable.php @@ -78,7 +78,6 @@ abstract class IPF_ORM_Configurable extends IPF_ORM_Locator_Injectable case IPF_ORM::ATTR_QUERY_CACHE_LIFESPAN: case IPF_ORM::ATTR_RECURSIVE_MERGE_FIXTURES; case IPF_ORM::ATTR_SINGULARIZE_IMPORT; - case IPF_ORM::ATTR_USE_DQL_CALLBACKS; break; case IPF_ORM::ATTR_SEQCOL_NAME: diff --git a/ipf/orm/manager.php b/ipf/orm/manager.php index f28ad39..9390e99 100644 --- a/ipf/orm/manager.php +++ b/ipf/orm/manager.php @@ -25,7 +25,6 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato IPF_ORM::ATTR_DECIMAL_PLACES => 2, IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE => 'ipf', IPF_ORM::ATTR_AUTOLOAD_TABLE_CLASSES => false, - IPF_ORM::ATTR_USE_DQL_CALLBACKS => false, ); } diff --git a/ipf/orm/query/abstract.php b/ipf/orm/query/abstract.php index d6149da..f09d5dc 100644 --- a/ipf/orm/query/abstract.php +++ b/ipf/orm/query/abstract.php @@ -508,63 +508,8 @@ abstract class IPF_ORM_Query_Abstract return $result; } - protected function _getDqlCallback() - { - $callback = false; - if ( ! empty($this->_dqlParts['from'])) { - switch ($this->_type) { - case self::DELETE: - $callback = array( - 'callback' => 'preDqlDelete', - 'const' => IPF_ORM_Event::RECORD_DQL_DELETE - ); - break; - case self::UPDATE: - $callback = array( - 'callback' => 'preDqlUpdate', - 'const' => IPF_ORM_Event::RECORD_DQL_UPDATE - ); - break; - case self::SELECT: - $callback = array( - 'callback' => 'preDqlSelect', - 'const' => IPF_ORM_Event::RECORD_DQL_SELECT - ); - break; - } - } - - return $callback; - } - protected function _preQuery() { - if ( ! $this->_preQueried && IPF_ORM_Manager::getInstance()->getAttribute('use_dql_callbacks')) { - $this->_preQueried = true; - - $callback = $this->_getDqlCallback(); - - // if there is no callback for the query type, then we can return early - if ( ! $callback) { - return; - } - - $copy = $this->copy(); - $copy->getSqlQuery(); - - foreach ($copy->getQueryComponents() as $alias => $component) { - $table = $component['table']; - $record = $table->getRecordInstance(); - - // Trigger preDql*() callback event - $params = array('component' => $component, 'alias' => $alias); - $event = new IPF_ORM_Event($record, $callback['const'], $this, $params); - - $record->$callback['callback']($event); - $table->notifyRecordListeners($callback['callback'], $event); - } - } - // Invoke preQuery() hook on IPF_ORM_Query for child classes which implement this hook $this->preQuery(); } diff --git a/ipf/orm/record.php b/ipf/orm/record.php index ec57cb0..4e730fb 100644 --- a/ipf/orm/record.php +++ b/ipf/orm/record.php @@ -143,12 +143,6 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab public function postInsert($event){} - public function preDqlSelect($event){} - - public function preDqlUpdate($event){} - - public function preDqlDelete($event){} - public function getErrorStack(){ if ( ! $this->_errorStack) { $this->_errorStack = new IPF_ORM_Validator_ErrorStack(get_class($this)); -- 2.49.0