setCacheQueries($options['queries']); } if (isset($options['metadata'])) { $this->setCacheMetadata($options['metadata']); } if (isset($options['routes'])) { $this->setCacheRoutes($options['routes']); } if (isset($options['serialization'])) { $this->setSerialization($options['serialization']); } } /** * * get cache queries flag * * @return bool */ public function getCacheQueries() { return $this->_cacheQueries; } /** * * set cache queries flag * * @param bool $cacheQueries * * @return $this */ public function setCacheQueries($cacheQueries) { $this->_cacheQueries = $cacheQueries; return $this; } /** * * get cache metadata flag * * @return bool */ public function getCacheMetadata() { return $this->_cacheMetadata; } /** * * set cache metadata flag * * @param bool $cacheMetadata * * @return $this */ public function setCacheMetadata($cacheMetadata) { $this->_cacheMetadata = (bool)$cacheMetadata; return $this; } /** * * get cache routes flag * * @return bool */ public function getCacheRoutes() { return $this->_cacheRoutes; } /** * * set cache routes flag * * @param bool $cacheRoutes * * @return $this */ public function setCacheRoutes($cacheRoutes) { $this->_cacheRoutes = (bool)$cacheRoutes; return $this; } /** * * get serialization flag * * @return bool */ public function getSerialization() { return $this->_serialization; } /** * * set serialization flag * * @param bool $serialization * * @return $this */ public function setSerialization($serialization) { $this->_serialization = (bool)$serialization; return $this; } /** * * get expiration time * * @return int */ public function getExpires() { return $this->_expires; } /** * * set expiration time * * @param int $expires * * @return $this */ public function setExpires($expires) { $this->_expires = (int)$expires; return $this; } /** * * read from cache * * @param string $name * @param string $type */ abstract public function read($name, $type); /** * * write to cache * * @param string $name * @param string $type * @param mixed $data * @param int $expires */ abstract public function write($name, $type, $data, $expires = null); /** * * delete variable from cache * * @param string $name * @param string $type */ abstract public function delete($name, $type); /** * * purge cached variables * * @param string $type * @param boolean $force */ abstract public function purge($type, $force = false); /** * * clear cache */ abstract public function clear(); }