Neos\Cache\Backend\AbstractBackend::setCache PHP Метод

setCache() публичный Метод

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
Результат void
    public function setCache(FrontendInterface $cache)
    {
        $this->cache = $cache;
        $this->cacheIdentifier = $this->cache->getIdentifier();
    }

Usage Example

 /**
  * Sets a reference to the cache frontend which uses this backend and
  * initializes the default cache directory.
  *
  * @param \Neos\Cache\Frontend\FrontendInterface $cache The cache frontend
  * @return void
  * @throws Exception
  */
 public function setCache(FrontendInterface $cache)
 {
     parent::setCache($cache);
     $this->cacheEntryFileExtension = $cache instanceof PhpFrontend ? '.php' : '';
     $this->configureCacheDirectory();
 }
All Usage Examples Of Neos\Cache\Backend\AbstractBackend::setCache