[geeklog-cvs] Geeklog-2/system/DataAccess DAO.php,1.1.1.1,1.2 NamedQueries.xml,1.2,1.3 PropelDAO.php,1.2,1.3 DAOFactory.php,1.2,NONE

tony at iowaoutdoors.org tony at iowaoutdoors.org
Mon Dec 20 22:21:55 EST 2004


Update of /var/cvs/Geeklog-2/system/DataAccess
In directory www:/tmp/cvs-serv15062

Modified Files:
	DAO.php NamedQueries.xml PropelDAO.php 
Removed Files:
	DAOFactory.php 
Log Message:
For consistency sake, added DAOInterface and moved factory-ish code to 
DAO.php


Index: NamedQueries.xml
===================================================================
RCS file: /var/cvs/Geeklog-2/system/DataAccess/NamedQueries.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NamedQueries.xml	20 Dec 2004 22:06:40 -0000	1.2
--- NamedQueries.xml	21 Dec 2004 03:21:52 -0000	1.3
***************
*** 4,6 ****
--- 4,9 ----
  		<criteria propelPeer="GL2UserPeer" column="USER_NAME" propelOperator="" testValue="tony"/>
  	</query>
+ 	<query name="getPluginByName" type="propel">
+ 		<criteria propelPeer="Gl2PluginPeer" column="PLUGIN_NAME" propelOperator="" testValue="kernel"/>
+ 	</query>
  </named_queries>
\ No newline at end of file

Index: DAO.php
===================================================================
RCS file: /var/cvs/Geeklog-2/system/DataAccess/DAO.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** DAO.php	17 Dec 2004 23:35:47 -0000	1.1.1.1
--- DAO.php	21 Dec 2004 03:21:52 -0000	1.2
***************
*** 1,18 ****
  <?php
  
! interface Geeklog_DAO {
! 	const MAX_RESULTS = 500;
! 	public function save($objToSave);
! 	public function delete($objToDelete);
! 	public function get($objToGet); // object with only PK set
! 	//public function getAll($objToGet); // empty instance of object
! 	public function find($queryName, $args=null, $page = null, $recordCount = null);
! 	/*public function search($queryName, $strictParams, $looseParams, $looseParamTrail = null, 
! 		$page = null, $recordCount = null);
! 	public function searchWithOR($queryName, $strictParams, $looseParams, $page, $recordCount);	*/
! 	public function beginTransaction();
! 	public function endTransaction();
! 	public function commit();
! 	//public function rollback();
  }
  
--- 1,34 ----
  <?php
  
! class Geeklog_DAO {
! 	public static function &singleton()
! 	{
! 		global $glConf;
! 				
! 		$fileToInclude = $glConf['path_system'] . 'DataAccess/' . $glConf['dao_object'] . '.php';
! 		if (include_once($fileToInclude)) {
! 			// Get around Geeklog 2 coding standards
! 			$nameOfClass = 'Geeklog_' . $glConf['dao_object'];
!             return new $nameOfClass();
!         }
! 	}
! 
! 	public static function &factory()
! 	{
! 		global $glConf;
! 		
! 		static $instances;
! 		
!         if (!isset($instances)) {
!             $instances = array();
!         }
! 
!         $hash = serialize(array($glConf['dao_object']));
!         if (!isset($instances[$hash])) {
!             $instances[$hash] = &self::factory();
!         }
! 
!         return $instances[$hash];
! 	}
  }
  

--- DAOFactory.php DELETED ---

Index: PropelDAO.php
===================================================================
RCS file: /var/cvs/Geeklog-2/system/DataAccess/PropelDAO.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PropelDAO.php	20 Dec 2004 22:06:40 -0000	1.2
--- PropelDAO.php	21 Dec 2004 03:21:53 -0000	1.3
***************
*** 6,10 ****
  * Data Access Object
  */
! require_once 'DataAccess/DAO.php';
  
  /**
--- 6,10 ----
  * Data Access Object
  */
! require_once 'DataAccess/DAOInterface.php';
  
  /**
***************
*** 19,23 ****
  *
  */
! class Geeklog_PropelDAO implements Geeklog_DAO {
  	/**
  	* Handle to XML DOM used to parsed the named queries file
--- 19,23 ----
  *
  */
! class Geeklog_PropelDAO implements Geeklog_DAOInterface {
  	/**
  	* Handle to XML DOM used to parsed the named queries file




More information about the geeklog-cvs mailing list