Exemple #1
0
 /**
  * Clear out the now invalid data from the cache
  *
  * @param Stash\Item $item
  * @return bool
  */
 public function clear($item)
 {
     return $item->clear();
 }
Exemple #2
0
 /**
  * Cache a value to the specified key
  *
  * @param string|\Psr\Cache\CacheItemInterface $value Value name
  * @param mixed $data Value
  * @param AbstractModule $mod Calling module
  */
 public function saveI($value, $data, AbstractModule $mod = null)
 {
     $this->checkInit();
     $item = $value;
     if (!$value instanceof CacheItemInterface) {
         $item = new \Stash\Item();
         $item->setKey($this->getKeyName($value, $mod));
     }
     $item->set($data);
     $this->cache->save($item);
 }