PHP Class CampCacheList

Simple class providing a standard interface to fetch and store list of objects (articles, issues, sections, attachments, etc) generated by static methods in several classes (e.g. Articles::GetList(), ArticleTypeField::FetchFields()).
Show file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$m_defaultTTL integer Default time to live in cache.

Public Methods

Method Description
__construct ( array $p_parameters, string $p_methodName, $p_defaultTTL = null ) Class constructor.
deleteFromCache ( )
fetchFromCache ( ) : mixed Fetch list with the given parameters from cache.
storeInCache ( array $p_list ) : void Store the list of items in cache.

Private Methods

Method Description
getCacheKey ( ) : string Generate the cache key for the list based on parameters.

Method Details

__construct() public method

Class constructor.
public __construct ( array $p_parameters, string $p_methodName, $p_defaultTTL = null )
$p_parameters array
$p_methodName string

deleteFromCache() public method

public deleteFromCache ( )

fetchFromCache() public method

Fetch list with the given parameters from cache.
public fetchFromCache ( ) : mixed
return mixed array $list List of items found in cache null List does not exist in cache

storeInCache() public method

Store the list of items in cache.
public storeInCache ( array $p_list ) : void
$p_list array
return void

Property Details

$m_defaultTTL protected property

Default time to live in cache.
protected int $m_defaultTTL
return integer