From d7c4d32c57d2b07b43c6fcade438d3187bb9ca08 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 14 May 2009 15:14:07 +0000 Subject: Fix for ticket #268 1) Added a clear method to model_cache 2) Cleared the model_cache, when the make_album_cover or remove_album_cover is called. --- core/helpers/model_cache.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/helpers/model_cache.php') diff --git a/core/helpers/model_cache.php b/core/helpers/model_cache.php index f4b11a6e..2649fdbd 100644 --- a/core/helpers/model_cache.php +++ b/core/helpers/model_cache.php @@ -32,6 +32,12 @@ class model_cache_Core { return self::$cache->$model_name->$field_name->$id; } + static function clear($model_name, $id, $field_name="id") { + if (!empty(self::$cache->$model_name->$field_name->$id)) { + unset(self::$cache->$model_name->$field_name->$id); + } + } + static function set($model) { self::$cache->{$model->object_name} ->{$model->primary_key} -- cgit v1.2.3