PHP Interface Neos\Cache\Backend\BackendInterface

Datei anzeigen Open project: neos/flow-development-collection

Public Methods

Method Description
collectGarbage ( ) : void Does garbage collection
flush ( ) : void Removes all cache entries of this cache.
get ( string $entryIdentifier ) : mixed Loads data from the cache.
getPrefixedIdentifier ( string $entryIdentifier ) : string Returns the internally used, prefixed entry identifier for the given public entry identifier.
has ( string $entryIdentifier ) : boolean Checks if a cache entry with the specified identifier exists.
remove ( string $entryIdentifier ) : boolean Removes all cache entries matching the specified identifier.
set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void Saves data in the cache.
setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void Sets a reference to the cache frontend which uses this backend

Method Details

collectGarbage() public method

Does garbage collection
public collectGarbage ( ) : void
return void

flush() public method

Removes all cache entries of this cache.
public flush ( ) : void
return void

get() public method

Loads data from the cache.
public get ( string $entryIdentifier ) : mixed
$entryIdentifier string An identifier which describes the cache entry to load
return mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded

getPrefixedIdentifier() public method

While Flow applications will mostly refer to the simple entry identifier, it may be necessary to know the actual identifier used by the cache backend in order to share cache entries with other applications. This method allows for retrieving it.
public getPrefixedIdentifier ( string $entryIdentifier ) : string
$entryIdentifier string
return string

has() public method

Checks if a cache entry with the specified identifier exists.
public has ( string $entryIdentifier ) : boolean
$entryIdentifier string An identifier specifying the cache entry
return boolean TRUE if such an entry exists, FALSE if not

remove() public method

Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.
public remove ( string $entryIdentifier ) : boolean
$entryIdentifier string Specifies the cache entry to remove
return boolean TRUE if (at least) an entry could be removed or FALSE if no entry was found

set() public method

Saves data in the cache.
public set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void
$entryIdentifier string An identifier for this specific cache entry
$data string The data to be stored
$tags array Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored.
$lifetime integer Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
return void

setCache() public method

Sets a reference to the cache frontend which uses this backend
public setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void
$cache Neos\Cache\Frontend\FrontendInterface The frontend for this backend
return void