PHP Class Neos\Cache\Backend\AbstractBackend

Inheritance: implements Neos\Cache\Backend\BackendInterface
显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$cache Neos\Cache\Frontend\FrontendInterface Reference to the cache frontend which uses this backend
$cacheIdentifier string
$defaultLifetime integer Default lifetime of a cache entry in seconds
$environmentConfiguration Neos\Cache\EnvironmentConfiguration

Public Methods

Method Description
__construct ( EnvironmentConfiguration $environmentConfiguration = null, array $options = [] ) Constructs this backend
getPrefixedIdentifier ( string $entryIdentifier ) : string Returns the internally used, prefixed entry identifier for the given public entry identifier.
setCache ( Neos\Cache\Frontend\FrontendInterface $cache ) : void Sets a reference to the cache frontend which uses this backend
setDefaultLifetime ( integer $defaultLifetime ) : void Sets the default lifetime for this cache backend

Protected Methods

Method Description
calculateExpiryTime ( integer $lifetime = null ) : DateTime Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.
setProperties ( array $properties, boolean $throwExceptionIfPropertyNotSettable = true ) : void
setProperty ( string $propertyName, mixed $propertyValue ) : boolean

Method Details

__construct() public method

Constructs this backend
public __construct ( EnvironmentConfiguration $environmentConfiguration = null, array $options = [] )
$environmentConfiguration Neos\Cache\EnvironmentConfiguration
$options array Configuration options - depends on the actual backend

calculateExpiryTime() protected method

Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.
protected calculateExpiryTime ( integer $lifetime = null ) : DateTime
$lifetime integer The lifetime in seconds
return DateTime The expiry time

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. Note that, in case of the AbstractBackend, this method is returns just the given entry identifier.
public getPrefixedIdentifier ( string $entryIdentifier ) : string
$entryIdentifier string The short entry identifier, for example "NumberOfPostedArticles"
return string The prefixed identifier, for example "Flow694a5c7a43a4_NumberOfPostedArticles"

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

setDefaultLifetime() public method

Sets the default lifetime for this cache backend
public setDefaultLifetime ( integer $defaultLifetime ) : void
$defaultLifetime integer Default lifetime of this cache backend in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime.
return void

setProperties() protected method

protected setProperties ( array $properties, boolean $throwExceptionIfPropertyNotSettable = true ) : void
$properties array
$throwExceptionIfPropertyNotSettable boolean
return void

setProperty() protected method

protected setProperty ( string $propertyName, mixed $propertyValue ) : boolean
$propertyName string
$propertyValue mixed
return boolean

Property Details

$cache protected_oe property

Reference to the cache frontend which uses this backend
protected FrontendInterface,Neos\Cache\Frontend $cache
return Neos\Cache\Frontend\FrontendInterface

$cacheIdentifier protected_oe property

protected string $cacheIdentifier
return string

$defaultLifetime protected_oe property

Default lifetime of a cache entry in seconds
protected int $defaultLifetime
return integer

$environmentConfiguration protected_oe property

protected EnvironmentConfiguration,Neos\Cache $environmentConfiguration
return Neos\Cache\EnvironmentConfiguration