From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../time-tracker/protected/App_Code/DaoManager.php | 156 ++++++++++----------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'demos/time-tracker/protected/App_Code/DaoManager.php') diff --git a/demos/time-tracker/protected/App_Code/DaoManager.php b/demos/time-tracker/protected/App_Code/DaoManager.php index bf25c555..705dd4d0 100644 --- a/demos/time-tracker/protected/App_Code/DaoManager.php +++ b/demos/time-tracker/protected/App_Code/DaoManager.php @@ -1,79 +1,79 @@ - - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2006 PradoSoft - * @license http://www.pradosoft.com/license/ - * @version $Id$ - * @package Demos - */ - -Prado::using('System.Data.SqlMap.TSqlMapConfig'); - -/** - * DaoManager class. - * - * A Registry for Dao and an implementation of that type. - * - * @author Wei Zhuo - * @version $Id$ - * @package Demos - * @since 3.1 - */ -class DaoManager extends TSqlMapConfig -{ - /** - * @var array registered list of dao - */ - private $_dao=array(); - - /** - * Initializes the module. - * This method is required by IModule and is invoked by application. - * It loads dao information from the module configuration. - * @param TXmlElement module configuration - */ - public function init($xml) - { - parent::init($xml); - foreach($xml->getElementsByTagName("dao") as $node) - { - $this->_dao[$node->getAttribute('id')] = - array('class' => $node->getAttribute('class')); - } - } - - /** - * @return array list of registered Daos - */ - public function getDaos() - { - return $this->_dao; - } - - /** - * Returns an implementation of a Dao type, implements the Registery - * pattern. Multiple calls returns the same Dao instance. - * @param string Dao type to find. - * @return object instance of the Dao implementation. - */ - public function getDao($class) - { - if(isset($this->_dao[$class])) - { - if(!isset($this->_dao[$class]['instance'])) - { - $dao = Prado::createComponent($this->_dao[$class]['class']); - $dao->setSqlMap($this->getClient()); - $this->_dao[$class]['instance'] = $dao; - } - return $this->_dao[$class]['instance']; - } - else - throw new TimeTrackerException('daomanager_undefined_dao', $class); - } -} - + + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2006 PradoSoft + * @license http://www.pradosoft.com/license/ + * @version $Id$ + * @package Demos + */ + +Prado::using('System.Data.SqlMap.TSqlMapConfig'); + +/** + * DaoManager class. + * + * A Registry for Dao and an implementation of that type. + * + * @author Wei Zhuo + * @version $Id$ + * @package Demos + * @since 3.1 + */ +class DaoManager extends TSqlMapConfig +{ + /** + * @var array registered list of dao + */ + private $_dao=array(); + + /** + * Initializes the module. + * This method is required by IModule and is invoked by application. + * It loads dao information from the module configuration. + * @param TXmlElement module configuration + */ + public function init($xml) + { + parent::init($xml); + foreach($xml->getElementsByTagName("dao") as $node) + { + $this->_dao[$node->getAttribute('id')] = + array('class' => $node->getAttribute('class')); + } + } + + /** + * @return array list of registered Daos + */ + public function getDaos() + { + return $this->_dao; + } + + /** + * Returns an implementation of a Dao type, implements the Registery + * pattern. Multiple calls returns the same Dao instance. + * @param string Dao type to find. + * @return object instance of the Dao implementation. + */ + public function getDao($class) + { + if(isset($this->_dao[$class])) + { + if(!isset($this->_dao[$class]['instance'])) + { + $dao = Prado::createComponent($this->_dao[$class]['class']); + $dao->setSqlMap($this->getClient()); + $this->_dao[$class]['instance'] = $dao; + } + return $this->_dao[$class]['instance']; + } + else + throw new TimeTrackerException('daomanager_undefined_dao', $class); + } +} + ?> \ No newline at end of file -- cgit v1.2.3