class CacheFactory implements CacheFactoryInterface (View source)

This cache factory takes care of instantiating a cache frontend and injecting a certain cache backend. After creation of the new cache, the cache object is registered at the cache manager.

Traits

Abstracts the task of creating a BackendInterface implementation with it's options.

Properties

protected EnvironmentConfiguration $environmentConfiguration

Methods

instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration)

No description

__construct(EnvironmentConfiguration $environmentConfiguration)

Constructs this cache factory

create(string $cacheIdentifier, string $cacheObjectName, string $backendObjectName, array $backendOptions = [])

Factory method which creates the specified cache along with the specified kind of backend.

instantiateCache(string $cacheIdentifier, string $cacheObjectName, BackendInterface $backend)

No description

Details

protected BackendInterface instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration)

No description

Parameters

string $backendObjectName
array $backendOptions
EnvironmentConfiguration $environmentConfiguration

Return Value

BackendInterface

Exceptions

InvalidBackendException

__construct(EnvironmentConfiguration $environmentConfiguration)

Constructs this cache factory

Parameters

EnvironmentConfiguration $environmentConfiguration

FrontendInterface create(string $cacheIdentifier, string $cacheObjectName, string $backendObjectName, array $backendOptions = [])

Factory method which creates the specified cache along with the specified kind of backend.

After creating the cache, it will be registered at the cache manager.

Parameters

string $cacheIdentifier

The name / identifier of the cache to create

string $cacheObjectName

Object name of the cache frontend

string $backendObjectName

Object name of the cache backend

array $backendOptions

(optional) Array of backend options

Return Value

FrontendInterface

The created cache frontend

Exceptions

InvalidBackendException
InvalidCacheException

protected FrontendInterface instantiateCache(string $cacheIdentifier, string $cacheObjectName, BackendInterface $backend)

No description

Parameters

string $cacheIdentifier
string $cacheObjectName
BackendInterface $backend

Return Value

FrontendInterface

Exceptions

InvalidCacheException