getIdentifier() public method

Returns this cache's identifier
public getIdentifier ( ) : string
return string The identifier for this cache
Esempio n. 1
0
 /**
  * Registers a cache so it can be retrieved at a later point.
  *
  * @param FrontendInterface $cache The cache frontend to be registered
  * @param bool $persistent
  * @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;
     }
 }
 /**
  * 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();
 }