PHP Interface Prado\Caching\ICache

This interface must be implemented by cache managers.
Since: 3.0
Author: Qiang Xue ([email protected])
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
add ( $id, $value, $expire, $dependency = null ) : boolean Stores a value identified by a key into cache if the cache does not contain this key.
delete ( $id ) : boolean Deletes a value with the specified key from cache
flush ( ) Deletes all values from cache.
get ( $id ) : mixed Retrieves a value from cache with a specified key.
set ( $id, $value, $expire, $dependency = null ) : boolean Stores a value identified by a key into cache.

Method Details

add() public méthode

Nothing will be done if the cache already contains the key.
public add ( $id, $value, $expire, $dependency = null ) : boolean
Résultat boolean true if the value is successfully stored into cache, false otherwise

delete() public méthode

Deletes a value with the specified key from cache
public delete ( $id ) : boolean
Résultat boolean if no error happens during deletion

flush() public méthode

Be careful of performing this operation if the cache is shared by multiple applications.
public flush ( )

get() public méthode

Retrieves a value from cache with a specified key.
public get ( $id ) : mixed
Résultat mixed the value stored in cache, false if the value is not in the cache or expired.

set() public méthode

If the cache already contains such a key, the existing value and expiration time will be replaced with the new ones.
public set ( $id, $value, $expire, $dependency = null ) : boolean
Résultat boolean true if the value is successfully stored into cache, false otherwise