/** * Retrieve an item from the cache by key. * * @param string $key * @param mixed $default * @return mixed */ public function get($key, $default = null) { $value = $this->store->get($key); if (is_null($value)) { $this->fireCacheEvent('missed', [$key]); $value = value($default); } else { $this->fireCacheEvent('hit', [$key, $value]); } return $value; }
/** * Retrieves the data associated with a particular wheel name. * * @param string $name * @return array */ public function getData($name) { if (!array_key_exists($name, $this->data)) { $data = $this->cache->get('flywheel:' . $name); if (!$data) { $parts = array(0, 0); } else { $parts = explode(',', $data); } $this->data[$name] = $parts; } return $this->data[$name]; }
/** * Get the unique section identifier. * * @return string */ protected function sectionId() { $id = $this->store->get($this->sectionKey()); if (is_null($id)) { $id = $this->reset(); } return $id; }
/** * Get the unique tag identifier for a given tag. * * @param string $name * @return string */ public function tagId($name) { return $this->store->get($this->tagKey($name)) ?: $this->resetTag($name); }
/** * Retrieve an item from the cache by key. * * @param string $key * @param mixed $default * @return mixed */ public function get($key, $default = null) { $value = $this->store->get($key); return !is_null($value) ? $value : value($default); }
/** * @param $key * @return mixed */ public function get($key) { return $this->cache->get($this->key($key)); }