PHP Class Pop\Cache\Cache

Author: Nick Sagona, III ([email protected])
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$adapter mixed Cache adapter
$lifetime integer Lifetime value

Méthodes publiques

Méthode Description
__construct ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache Constructor
adapter ( ) : mixed Method to get the adapter
clear ( ) : void Method to clear all stored values from cache.
factory ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache Static method to instantiate the cache object and return itself to facilitate chaining methods together.
getAdapters ( ) : array Static method to determine available adapters
getLifetime ( ) : integer Method to get the cache lifetime.
load ( string $id ) : mixed Method to load a value from cache.
remove ( string $id ) : void Method to delete a value in cache.
save ( string $id, mixed $value ) : void Method to save a value to cache.
setLifetime ( integer $time ) : Cache Method to set the cache lifetime.

Method Details

__construct() public méthode

Instantiate the cache object
public __construct ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache
$adapter Pop\Cache\Adapter\AdapterInterface
$lifetime integer
Résultat Cache

adapter() public méthode

Method to get the adapter
public adapter ( ) : mixed
Résultat mixed

clear() public méthode

Method to clear all stored values from cache.
public clear ( ) : void
Résultat void

factory() public static méthode

Static method to instantiate the cache object and return itself to facilitate chaining methods together.
public static factory ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache
$adapter Pop\Cache\Adapter\AdapterInterface
$lifetime integer
Résultat Cache

getAdapters() public static méthode

Static method to determine available adapters
public static getAdapters ( ) : array
Résultat array

getLifetime() public méthode

Method to get the cache lifetime.
public getLifetime ( ) : integer
Résultat integer

load() public méthode

Method to load a value from cache.
public load ( string $id ) : mixed
$id string
Résultat mixed

remove() public méthode

Method to delete a value in cache.
public remove ( string $id ) : void
$id string
Résultat void

save() public méthode

Method to save a value to cache.
public save ( string $id, mixed $value ) : void
$id string
$value mixed
Résultat void

setLifetime() public méthode

Method to set the cache lifetime.
public setLifetime ( integer $time ) : Cache
$time integer
Résultat Cache

Property Details

$adapter protected_oe property

Cache adapter
protected mixed $adapter
Résultat mixed

$lifetime protected_oe property

Lifetime value
protected int $lifetime
Résultat integer