Esempio n. 1
0
 /**
  * Retrieve an item from the cache by key.
  *
  * @param  mixed  $key
  * @param  mixed  $default
  * @return mixed
  */
 public function get($key, $default = null)
 {
     if (is_array($key)) {
         return $this->getMany($key, $default);
     }
     return parent::get($key, $default);
 }
Esempio n. 2
0
 /**
  * @param $method string the methode name of the parent method
  * @param $args array the method parameters
  * @return mixed
  */
 protected function _cachedOrFromParent($method, $args)
 {
     $cacheKey = $this->getCacheKey([get_called_class() . '::' . $method, serialize($args)]);
     if ($this->_cache->has($cacheKey)) {
         $ret = $this->_cache->get($cacheKey);
     } else {
         $ret = call_user_func_array(array('parent', $method), $args);
         $this->_cache->forever($cacheKey, $ret);
     }
     return $ret;
 }