summaryrefslogtreecommitdiff
path: root/core/helpers/model_cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/model_cache.php')
-rw-r--r--core/helpers/model_cache.php6
1 files changed, 6 insertions, 0 deletions
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}