mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-23 21:09:11 -04:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user