/** * * @param string $name fragment name * @param integer $lifetime fragment cache lifetime * @param boolean $i18n multilingual fragment support * @return string */ public static function get($name, $lifetime = NULL, $i18n = NULL) { // Set the cache lifetime $lifetime = $lifetime === NULL ? Fragment::$lifetime : (int) $lifetime; // Get the cache key name $cache_key = Fragment::_cache_key($name, $i18n); // If cache lifetime < 0 then clear if ($lifetime < 0) { Fragment::delete($name, $i18n); } return Cache::instance()->get($cache_key); }
private function delete_album_fragment($id) { try { Fragment::delete("album_{$id}"); } catch (Exception $e) { } }
/** * Метод очистки кеша виджета. * * @todo Не совсем корректно работает с динамическим кешем * @return \Model_Widget_Decorator */ public function clear_cache() { if ($this->caching === TRUE) { Fragment::delete($this->get_cache_id()); } return $this; }