Lines Matching defs:data
51 * Caches data to memcached
57 * prefixed with `sp_` and data will expire after 3600 seconds
89 * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
110 * Save data to the cache
111 * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
114 public function save($data)
116 if ($data instanceof \SimplePie\SimplePie) {
117 $data = $data->data;
120 return $this->setData(serialize($data));
124 * Retrieve the data saved to the cache
125 * @return array Data for SimplePie::$data
129 $data = $this->cache->get($this->name);
131 if ($data !== false) {
132 return unserialize($data);
143 $data = $this->cache->get($this->name . '_mtime');
144 return (int) $data;
153 $data = $this->cache->get($this->name);
154 return $this->setData($data);
167 * Set the last modified time and data to NativeMemcached
170 private function setData($data)
172 if ($data !== false) {
174 return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);