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.
This commit is contained in:
Tim Almdal
2009-05-14 15:14:07 +00:00
parent c8c82eff66
commit d7c4d32c57
2 changed files with 8 additions and 0 deletions

View File

@@ -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}