Neos\Flow\Cache\CacheManager::getCache PHP Method

getCache() public method

Returns the cache specified by $identifier
public getCache ( string $identifier ) : Neos\Cache\Frontend\FrontendInterface
$identifier string Identifies which cache to return
return Neos\Cache\Frontend\FrontendInterface The specified cache frontend
    public function getCache($identifier)
    {
        if ($this->hasCache($identifier) === false) {
            throw new NoSuchCacheException('A cache with identifier "' . $identifier . '" does not exist.', 1203699034);
        }
        if (!isset($this->caches[$identifier])) {
            $this->createCache($identifier);
        }
        return $this->caches[$identifier];
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param $fileMonitorIdentifier
  * @param array $changedFiles
  * @return void
  */
 public function flushContentCacheOnFileChanges($fileMonitorIdentifier, array $changedFiles)
 {
     $fileMonitorsThatTriggerContentCacheFlush = array('TYPO3CR_NodeTypesConfiguration', 'TypoScript_Files', 'Fluid_TemplateFiles', 'Flow_ClassFiles', 'Flow_ConfigurationFiles', 'Flow_TranslationFiles');
     if (in_array($fileMonitorIdentifier, $fileMonitorsThatTriggerContentCacheFlush)) {
         $this->flowCacheManager->getCache('Neos_Fusion_Content')->flush();
     }
 }
All Usage Examples Of Neos\Flow\Cache\CacheManager::getCache