TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Cache\CacheFactory Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\CacheFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ($context, \TYPO3\CMS\Core\Cache\CacheManager $cacheManager)
 
 create ($cacheIdentifier, $cacheObjectName, $backendObjectName, array $backendOptions=[])
 

Protected Attributes

 $context
 
 $cacheManager
 

Detailed Description

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.

This file is a backport from FLOW3 singleton

Definition at line 26 of file CacheFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Cache\CacheFactory::__construct (   $context,
\TYPO3\CMS\Core\Cache\CacheManager  $cacheManager 
)

Constructs this cache factory

Parameters
string$contextThe current FLOW3 context
\TYPO3\CMS\Core\Cache\CacheManager$cacheManagerThe cache manager

Definition at line 51 of file CacheFactory.php.

References TYPO3\CMS\Core\Cache\CacheFactory\$cacheManager, and TYPO3\CMS\Core\Cache\CacheFactory\$context.

Member Function Documentation

◆ create()

TYPO3\CMS\Core\Cache\CacheFactory::create (   $cacheIdentifier,
  $cacheObjectName,
  $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$cacheIdentifierThe name / identifier of the cache to create
string$cacheObjectNameObject name of the cache frontend
string$backendObjectNameObject name of the cache backend
array$backendOptions(optional) Array of backend options
Returns
The created cache frontend
Exceptions

Definition at line 71 of file CacheFactory.php.

Member Data Documentation

◆ $cacheManager

TYPO3\CMS\Core\Cache\CacheFactory::$cacheManager
protected

Definition at line 43 of file CacheFactory.php.

Referenced by TYPO3\CMS\Core\Cache\CacheFactory\__construct().

◆ $context

TYPO3\CMS\Core\Cache\CacheFactory::$context
protected

Definition at line 36 of file CacheFactory.php.

Referenced by TYPO3\CMS\Core\Cache\CacheFactory\__construct().