PHP Class Cache\Bridge\DoctrineCacheBridge

Author: Aaron Scherer ([email protected])
Inheritance: extends Doctrine\Common\Cache\CacheProvider
Datei anzeigen Open project: php-cache/cache

Public Methods

Method Description
__construct ( Psr\Cache\CacheItemPoolInterface $cachePool ) DoctrineCacheBridge constructor.
getCachePool ( ) : Psr\Cache\CacheItemPoolInterface

Protected Methods

Method 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.
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.

Private Methods

Method Description
normalizeKey ( string $key ) : string We need to make sure we do not use any characters not supported.

Method Details

__construct() public method

DoctrineCacheBridge constructor.
public __construct ( Psr\Cache\CacheItemPoolInterface $cachePool )
$cachePool Psr\Cache\CacheItemPoolInterface

doContains() protected method

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

doDelete() protected method

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

doFetch() protected method

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

doFlush() protected method

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

doGetStats() protected method

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

doSave() protected method

Puts data into the cache.
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).
return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.

getCachePool() public method

public getCachePool ( ) : Psr\Cache\CacheItemPoolInterface
return Psr\Cache\CacheItemPoolInterface