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