コード例 #1
0
 /**
  * Store an item in the cache indefinitely.
  *
  * @param string $key
  * @param mixed  $value
  */
 public function forever($key, $value)
 {
     $this->cache->forever($this->prefix . $key, $value);
 }
コード例 #2
0
 /**
  * forgetMenuMapByKey
  *
  * @param string $menuKey to forget on menu map
  *
  * @return void
  */
 public function forgetMenuMapByKey($menuKey)
 {
     $menuMap = [];
     if ($this->cache->has($this->menuMapKey)) {
         $oldMenuMap = $this->cache->get($this->menuMapKey);
         foreach ($oldMenuMap as $key => $value) {
             if ($key !== $menuKey && $key !== $value) {
                 $menuMap[$key] = $value;
             }
         }
     }
     $this->cache->forever($this->menuMapKey, $menuMap);
 }