Пример #1
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure $callback
  *
  * @return mixed
  */
 public function sear($key, Closure $callback)
 {
     if ($this->enabled) {
         return $this->cache->sear($key, $callback);
     }
     return $callback;
 }
Пример #2
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param string $key
  * @param \Closure $callback
  * @return mixed 
  * @static 
  */
 public static function sear($key, $callback)
 {
     return \Illuminate\Cache\Repository::sear($key, $callback);
 }
Пример #3
0
 /**
  * Get an item from the cache, or store the default value forever.
  *
  * @param  string   $key
  * @param  \Closure  $callback
  * @return mixed
  */
 public function sear($key, Closure $callback)
 {
     if (is_array($key)) {
         return $this->searMany($key, $callback);
     }
     return parent::sear($key, $callback);
 }