/** * Set a value into the cache * * @param \Itkg\Core\CacheableInterface $item * * @return void */ public function set(CacheableInterface $item) { $this->getConnection()->set($item->getHashKey(), $item->getDataForCache()); if (null !== $item->getTtl()) { $this->getConnection()->expire($item->getHashKey(), $item->getTtl()); } }
/** * Set a value into the cache * * @param \Itkg\Core\CacheableInterface $item * * @return void */ public function set(CacheableInterface $item) { $this->values[$item->getHashKey()] = $item->getDataForCache(); }
/** * Set a value into the cache * * @param CacheableInterface $item * * @return void */ public function set(CacheableInterface $item) { $this->connection->set($item->getHashKey(), $item->getDataForCache(), $item->getTtl()); }
/** * Set a value into the cache * * @param CacheableInterface $item * * @return void */ 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)); } }
/** * Set a value into the cache * * @param \Itkg\Core\CacheableInterface $item * * @return void */ public function set(CacheableInterface $item) { $this->provider->save($item->getHashKey(), $item->getDataForCache(), $item->getTtl()); }