/** * Registers a cache so it can be retrieved at a later point. * * @param \TYPO3\Flow\Cache\Frontend\FrontendInterface $cache The cache frontend to be registered * @return void * @throws \TYPO3\Flow\Cache\Exception\DuplicateIdentifierException if a cache with the given identifier has already been registered. * @api */ public function registerCache(\TYPO3\Flow\Cache\Frontend\FrontendInterface $cache, $persistent = FALSE) { $identifier = $cache->getIdentifier(); if (isset($this->caches[$identifier])) { throw new \TYPO3\Flow\Cache\Exception\DuplicateIdentifierException('A cache with identifier "' . $identifier . '" has already been registered.', 1203698223); } $this->caches[$identifier] = $cache; if ($persistent === TRUE) { $this->persistentCaches[$identifier] = $cache; } }
/** * Sets a reference to the cache frontend which uses this backend * * @param FrontendInterface $cache The frontend for this backend * @return void * @api */ public function setCache(FrontendInterface $cache) { $this->cache = $cache; $this->cacheIdentifier = $this->cache->getIdentifier(); }
/** * Sets a reference to the cache frontend which uses this backend * * @param \TYPO3\Flow\Cache\Frontend\FrontendInterface $cache The frontend for this backend * @return void * @api */ public function setCache(\TYPO3\Flow\Cache\Frontend\FrontendInterface $cache) { $this->cache = $cache; $this->cacheIdentifier = $this->cache->getIdentifier(); }
/** * Registers a cache so it can be retrieved at a later point. * * @param FrontendInterface $cache The cache frontend to be registered * @return void * @throws DuplicateIdentifierException if a cache with the given identifier has already been registered. * @api */ public function registerCache(FrontendInterface $cache, $persistent = false) { $identifier = $cache->getIdentifier(); if (isset($this->caches[$identifier])) { throw new DuplicateIdentifierException('A cache with identifier "' . $identifier . '" has already been registered.', 1203698223); } $this->caches[$identifier] = $cache; if ($persistent === true) { $this->persistentCaches[$identifier] = $cache; } }