class CacheFactory extends CacheFactory (View source)

This cache factory takes care of instantiating a cache frontend and injecting a certain cache backend. In a Flow context you should use the CacheManager to get a Cache.

Traits

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

Properties

protected EnvironmentConfiguration $environmentConfiguration
protected ApplicationContext $context

The current Flow context ("Production", "Development" etc.)

protected CacheManager $cacheManager

A reference to the cache manager

protected Environment $environment

Methods

instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration, bool $persistent = false)

No description

__construct(ApplicationContext $context, Environment $environment, string $applicationIdentifier)

Constructs this cache factory

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

No description

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

No description

injectCacheManager(CacheManager $cacheManager)

No description

injectEnvironmentConfiguration(EnvironmentConfiguration $environmentConfiguration)

No description

Details

protected BackendInterface instantiateBackend(string $backendObjectName, array $backendOptions, EnvironmentConfiguration $environmentConfiguration, bool $persistent = false)

No description

Parameters

string $backendObjectName
array $backendOptions
EnvironmentConfiguration $environmentConfiguration
bool $persistent

Return Value

BackendInterface

Exceptions

InvalidBackendException

__construct(ApplicationContext $context, Environment $environment, string $applicationIdentifier)

Constructs this cache factory

Parameters

ApplicationContext $context

The current Flow context

Environment $environment
string $applicationIdentifier

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

No description

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

bool $persistent

Return Value

FrontendInterface

The created cache frontend

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

No description

Parameters

string $cacheIdentifier
string $cacheObjectName
BackendInterface $backend

Return Value

FrontendInterface

Exceptions

InvalidCacheException

injectCacheManager(CacheManager $cacheManager)

No description

Parameters

CacheManager $cacheManager

injectEnvironmentConfiguration(EnvironmentConfiguration $environmentConfiguration)

No description

Parameters

EnvironmentConfiguration $environmentConfiguration