PHP Class Doctrine\Common\Cache\CacheProvider

Since: 2.2
Author: Benjamin Eberlei ([email protected])
Author: Guilherme Blanco ([email protected])
Author: Jonathan Wage ([email protected])
Author: Roman Borschel ([email protected])
Author: Fabio B. Silva ([email protected])
Inheritance: implements Doctrine\Common\Cache\Cache
Afficher le fichier Open project: doctrine/cache Class Usage Examples

Méthodes publiques

Méthode Description
contains ( $id )
delete ( $id )
deleteAll ( ) {@inheritDoc}
fetch ( $id )
fetchMultiple ( array $keys )
flushAll ( ) {@inheritDoc}
getNamespace ( ) : string Retrieves the namespace that prefixes all cache ids.
getStats ( )
save ( $id, $data, $lifeTime )
saveMultiple ( array $keysAndValues, $lifetime )
setNamespace ( string $namespace ) : void Sets the namespace to prefix all cache ids with.

Méthodes protégées

Méthode Description
doContains ( string $id ) : boolean Tests if an entry exists in the cache.
doDelete ( string $id ) : boolean Deletes a cache entry.
doFetch ( string $id ) : mixed | false Fetches an entry from the cache.
doFetchMultiple ( array $keys ) : array Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
doFlush ( ) : boolean Flushes all cache entries.
doGetStats ( ) : array | null Retrieves cached information from the data store.
doSave ( string $id, string $data, integer $lifeTime ) : boolean Puts data into the cache.
doSaveMultiple ( array $keysAndValues, integer $lifetime ) : boolean Default implementation of doSaveMultiple. Each driver that supports multi-put should override it.

Private Methods

Méthode Description
getNamespaceCacheKey ( ) : string Returns the namespace cache key.
getNamespaceVersion ( ) : integer Returns the namespace version.
getNamespacedId ( string $id ) : string Prefixes the passed id with the configured namespace value.

Method Details

contains() public méthode

public contains ( $id )

delete() public méthode

public delete ( $id )

deleteAll() public méthode

{@inheritDoc}
public deleteAll ( )

doContains() abstract protected méthode

Tests if an entry exists in the cache.
abstract protected doContains ( string $id ) : boolean
$id string The cache id of the entry to check for.
Résultat boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.

doDelete() abstract protected méthode

Deletes a cache entry.
abstract protected doDelete ( string $id ) : boolean
$id string The cache id.
Résultat boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.

doFetch() abstract protected méthode

Fetches an entry from the cache.
abstract protected doFetch ( string $id ) : mixed | false
$id string The id of the cache entry to fetch.
Résultat mixed | false The cached data or FALSE, if no cache entry exists for the given id.

doFetchMultiple() protected méthode

Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
protected doFetchMultiple ( array $keys ) : array
$keys array Array of keys to retrieve from cache
Résultat array Array of values retrieved for the given keys.

doFlush() abstract protected méthode

Flushes all cache entries.
abstract protected doFlush ( ) : boolean
Résultat boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.

doGetStats() abstract protected méthode

Retrieves cached information from the data store.
Since: 2.2
abstract protected doGetStats ( ) : array | null
Résultat array | null An associative array with server's statistics if available, NULL otherwise.

doSave() abstract protected méthode

Puts data into the cache.
abstract protected doSave ( string $id, string $data, integer $lifeTime ) : boolean
$id string The cache id.
$data string The cache entry/data.
$lifeTime integer The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
Résultat boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.

doSaveMultiple() protected méthode

Default implementation of doSaveMultiple. Each driver that supports multi-put should override it.
protected doSaveMultiple ( array $keysAndValues, integer $lifetime ) : boolean
$keysAndValues array Array of keys and values to save in cache
$lifetime integer The lifetime. If != 0, sets a specific lifetime for these cache entries (0 => infinite lifeTime).
Résultat boolean TRUE if the operation was successful, FALSE if it wasn't.

fetch() public méthode

public fetch ( $id )

fetchMultiple() public méthode

public fetchMultiple ( array $keys )
$keys array

flushAll() public méthode

{@inheritDoc}
public flushAll ( )

getNamespace() public méthode

Retrieves the namespace that prefixes all cache ids.
public getNamespace ( ) : string
Résultat string

getStats() public méthode

public getStats ( )

save() public méthode

public save ( $id, $data, $lifeTime )

saveMultiple() public méthode

public saveMultiple ( array $keysAndValues, $lifetime )
$keysAndValues array

setNamespace() public méthode

Sets the namespace to prefix all cache ids with.
public setNamespace ( string $namespace ) : void
$namespace string
Résultat void