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