From cb36f5d0922bc23d3f7c7e228d8834deac465ea7 Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 17 Sep 2007 21:51:42 +0000 Subject: [PATCH] --- lib/Doctrine/Manager.php | 54 ++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/lib/Doctrine/Manager.php b/lib/Doctrine/Manager.php index a1c950213..00bf5c278 100644 --- a/lib/Doctrine/Manager.php +++ b/lib/Doctrine/Manager.php @@ -34,30 +34,29 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, IteratorAggregate { /** - * @var array $connections an array containing all the opened connections + * @var array $connections an array containing all the opened connections */ protected $_connections = array(); /** - * @var array $bound an array containing all components that have a bound connection + * @var array $bound an array containing all components that have a bound connection */ protected $_bound = array(); /** - * @var integer $index the incremented index + * @var integer $index the incremented index */ protected $_index = 0; /** - * @var integer $currIndex the current connection index + * @var integer $currIndex the current connection index */ protected $_currIndex = 0; /** - * @var string $root root directory + * @var string $root root directory */ protected $_root; /** - * @var array $_integrityActions an array containing all registered integrity actions - * used when emulating these actions + * @var Doctrine_Query_Registry the query registry */ - protected $_integrityActions = array(); + protected $_queryRegistry; protected static $driverMap = array('oci' => 'oracle'); /** @@ -71,30 +70,6 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera Doctrine_Object::initNullObject(new Doctrine_Null); } - public function addDeleteAction($componentName, $foreignComponent, $action) - { - $this->_integrityActions[$componentName]['onDelete'][$foreignComponent] = $action; - } - public function addUpdateAction($componentName, $foreignComponent, $action) - { - $this->_integrityActions[$componentName]['onUpdate'][$foreignComponent] = $action; - } - public function getDeleteActions($componentName) - { - if ( ! isset($this->_integrityActions[$componentName]['onDelete'])) { - return null; - } - - return $this->_integrityActions[$componentName]['onDelete']; - } - public function getUpdateActions($componentName) - { - if ( ! isset($this->_integrityActions[$componentName]['onUpdate'])) { - return null; - } - - return $this->_integrityActions[$componentName]['onUpdate']; - } /** * setDefaultAttributes * sets default attributes @@ -156,6 +131,21 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera } return $instance; } + + /** + * getQueryRegistry + * lazy-initializes the query registry object and returns it + * + * @return Doctrine_Query_Registry + */ + public function getQueryRegistry() + { + if ( ! isset($this->_queryRegistry)) { + $this->_queryRegistry = new Doctrine_Query_Registry; + } + return $this->_queryRegistry; + } + /** * connection *