Location: PHPKode > scripts > PHP DataCache > php-datacachea1/DataCacheDAO.php
<?php
/**
 *	DataCacheDAO class definiton
 *
 *	abstract base class for DAO used for the DataCache class
 *
 *	A PHP Class to implement server side data caching
 *	Copyright (C) 2003 Jason E. Sweat
 *
 *	This library is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU Lesser General Public
 *	License as published by the Free Software Foundation; either
 *	version 2.1 of the License, or (at your option) any later version.
 *
 *	This library is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *	Lesser General Public License for more details.
 *
 *	You should have received a copy of the GNU Lesser General Public
 *	License along with this library; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *	<pre>
 *		$Log: DataCacheDAO.php,v $
 *		Revision 1.1.1.1  2003/12/11 05:22:10  jsweat
 *		Initial check-in of PHP DataCache library.
 *		
 *	</pre>
 *	@author			Jason E. Sweat
 *	@since			2003-10-26
 *	@package		DataCache
 *	@subpackage		DAO
 *	@version		$Id: DataCacheDAO.php,v 1.1.1.1 2003/12/11 05:22:10 jsweat Exp $
 */

/**
 * This represents the contract that a DAO must adhere to in this application
 *
 * It is coded in such a way that you could extend this class, however, this would
 * entail additional overhead of including and parsing this file, so the concrete 
 * DAO classes are not actually implemented this way.
 *
 * @abstract
 * @package		DataCache
 * @subpackage	DAO
 */
class DataCacheDAO
{
	/**
	 * constructor
	 *
	 * @param	string	$psAppl	the application identifier
	 * @return	void
	 */
	function DataCacheDAO($psAppl)
	{
		die('DataCacheDAO is an Abstract Base Class, do not instanciate');
	}
	
	/**
	 * cache a particular piece of data
	 *
	 * @param	string	$psId		identifier for the data being cached
	 * @param	mixed	$pmValue	value to cache
	 * @param	boolean	$pbZip		optional - compress the data
	 * @return	void
	 */
	function SetCache($psId, $pmValue, $pbZip=true)
	{
		die('Override SetCache in child class to implement');
	}
	
	/**
	 * check to see if a cached data is valid
	 *
	 * @param	string	$psId		identifier for the data being cached
	 * @return	boolean				result of check
	 */
	function IsCached($psId)
	{
		die('Override IsCached in child class to implement');
	}
	
	
	/**
	 * retrieve some cached data
	 *
	 * @param	string	$psId		identifier for the data being cached
	 * @return	mixed				the data cached
	 */
	function GetCache($psId)
	{
		die('Override GetCache in child class to implement');
	}
	
}


#?>
Return current item: PHP DataCache