Neos\Cache\CacheFactory::instantiateCache PHP Метод

instantiateCache() защищенный Метод

protected instantiateCache ( string $cacheIdentifier, string $cacheObjectName, Neos\Cache\Backend\BackendInterface $backend ) : Neos\Cache\Frontend\FrontendInterface
$cacheIdentifier string
$cacheObjectName string
$backend Neos\Cache\Backend\BackendInterface
Результат Neos\Cache\Frontend\FrontendInterface
    protected function instantiateCache($cacheIdentifier, $cacheObjectName, $backend)
    {
        $cache = new $cacheObjectName($cacheIdentifier, $backend);
        if (!$cache instanceof FrontendInterface) {
            throw new InvalidCacheException('"' . $cacheObjectName . '" is not a valid cache frontend object.', 1216304300);
        }
        return $cache;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 protected function instantiateCache($cacheIdentifier, $cacheObjectName, $backend)
 {
     $cache = parent::instantiateCache($cacheIdentifier, $cacheObjectName, $backend);
     if (is_callable([$cache, 'initializeObject'])) {
         $cache->initializeObject(ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED);
     }
     return $cache;
 }