/** * Determine if an item exists in the cache. * * @param mixed $key * @return mixed */ public function has($key) { if (is_array($key)) { return $this->hasMany($key); } return parent::has($key); }
/** * @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; }