<?php
/**
* a generic interface that may be implemented to describe how a class should
* should implement cacheing. This interface is inspected by the BasePersistence class.
* If a subclass implements it, then each "getByFoo()" method will cache based on
* the sub classes CacheMethod and CacheLength, but only for entities that pass
* the cacheValide method.
*
* @author Cory Marsh
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/
interface Cacheable
{
/**
* @return string the name of the cache method 'MEMCACHE', 'FILE', 'MEMORY'
*/
public function getCacheMethod();
/**
* @return integer number of seconds that the data should be cached for
*/
public function getCacheLength();
/**
* @param ArrayList $entities list of entities resturned from the method...
* @return boolean true if the result should be cached
*/
public function valideEntities(ArrayList $enities);
/**
* @param array $rows raw sql result array values
* @return boolean true if the result should be cached
*/
public function valideRows(array $rows);
}