Sets a reference to the cache frontend which uses this backend

@param FrontendInterface $cache The frontend for this backend
@return void
@api
770739
public function setCache(FrontendInterface $cache)
    {
        $this->cache = $cache;
        $this->cacheIdentifier = $this->cache->getIdentifier();
    }
724593
public function forget(RecordInterface $entity)
    {
        $cacheID = get_class($entity) . ':' . $entity->primaryKey();
        unset($this->entities[$cacheID]);
    }
317383
public function setCacheStorage(WURFL_Storage_Base $cache)
    {
        if (!$this->supportsSecondaryCaching()) {
            throw new WURFL_Storage_Exception("The storage provider ".get_class($cache)." cannot be used as a cache for ".get_class($this));
        }
        $this->cache = $cache;
    }
982599
public function set_hyphenator_cache( Hyphenator\Cache $cache ) {
		$this->hyphenator_cache = $cache;

		// Change hyphenator cache for existing token fixes.
		if ( isset( $this->registry ) ) {
			$this->registry->update_hyphenator_cache( $cache );
		}
	}
1162944
public function set(CacheableInterface $item)
    {
        $targetFile = $this->getTargetFile($item->getHashKey());

        $cacheData = serialize($item->getDataForCache());

        if (!file_put_contents($targetFile, sprintf('%s%s;', self::STR_PREFIX, $cacheData))) {
            throw new \RuntimeException(
                sprintf(
                    'Unable to write cache file %s with data : %s',
                    $targetFile,
                    $cacheData
                )
            );
        }
    }
15255
public synchronized void setCache(RemoteListCache cache) {
		if (cache != null && (this.cache == null || !this.cache.isComplete())) {
			this.cache = cache;
		}
	}
148319
public function addCache(Cache $cache, $prepend = true)
    {
        if ($prepend) {
            \array_unshift($this->caches, $cache);
        } else {
            $this->caches[] = $cache;
        }
    }
34828
public function set(Cache $cache, $userName)
    {
        if (!is_writable(dirname($this->getCacheFile($userName)))) {
            throw new CacheException('Cache folder is not writable');
        }

        $data   = serialize($cache);
        $handle = fopen($this->getCacheFile($userName), 'w+');

        fwrite($handle, $data);
        fclose($handle);
    }
268878
public function evaluateDependency($cache): void
    {
        if ($this->reusable) {
            $hash = $this->generateReusableHash();
            if (!array_key_exists($hash, self::$_reusableData)) {
                self::$_reusableData[$hash] = $this->generateDependencyData($cache);
            }
            $this->data = self::$_reusableData[$hash];
        } else {
            $this->data = $this->generateDependencyData($cache);
        }
    }
237104
public final function resolve(string $className, CacheInterface $cache = null)
   {
       try {
           return $this->resolver->resolve($className, $cache);
       } catch (NotFoundException $e) {
           throw $e;
       } catch (ContainerException $e) {
           throw $e;
       }
   }
643441
public function flushCaches(bool $flushPersistentCaches = false): void
    {
        $this->createAllCaches();
        /** @var FrontendInterface $cache */
        foreach ($this->caches as $identifier => $cache) {
            if (!$flushPersistentCaches && $this->isCachePersistent($identifier)) {
                continue;
            }
            $cache->flush();
        }
        $this->configurationManager->flushConfigurationCache();
        $dataTemporaryPath = $this->environment->getPathToTemporaryDirectory();
        Files::unlink($dataTemporaryPath . 'AvailableProxyClasses.php');
    }
964976
public static function cache(CacheInterface $cache = null)
	{
		if($cache) {
			static::$cache = $cache;
		}
		elseif(!static::$cache) {
			static::$cache = new Annotation\EphemeralCache;
		}

		return static::$cache;
	}
525901
protected function setCache()
    {
        if ($this->cache) {
            $cacheFile = $this->getCacheFile();
            file_put_contents($cacheFile, $this->templateOutput);
        }
    }
458731
public function setCache($cache, $namespace = null)
    {
        if($cache && ObjectRegistryCache::isSupported())
        {
            $this->__registry = new ObjectRegistryCache();

            if($namespace) {
                $this->__registry->setNamespace($namespace);
            }
        }
        else
        {
            if(!$this->__registry instanceof ObjectRegistry) {
                $this->__registry = new ObjectRegistry();
            }
        }

        return $this;
    }
1063296
public function set(EntityInterface $entity)
    {
        $key = get_class($entity).'::'.$entity->getId();
        $this->getCache()->set($key, $entity);
        return $this;
    }
848428
public function set(array $adapters, CacheableInterface $item)
    {
        foreach ($adapters as $adapter) {
            $adapter->set($item);
        }
    }
638010
public function decorate(&$cache)
    {
        $decorator = $this->copy();
        // reference is necessary for mocks in PHP 4
        $decorator->cache =& $cache;
        $decorator->type = $cache->type;
        return $decorator;
    }