diff --git a/web/includes/Event.php b/web/includes/Event.php index a9eb99d59..a2f4f47c9 100644 --- a/web/includes/Event.php +++ b/web/includes/Event.php @@ -50,6 +50,9 @@ class Event extends ZM_Object { public static function clear_cache() { return ZM_Object::_clear_cache(get_class()); } + public function remove_from_cache() { + return ZM_Object::_remove_from_cache(get_class(), $this); + } public function Storage( $new = null ) { if ( $new ) { diff --git a/web/includes/Object.php b/web/includes/Object.php index f49497276..d7fa8c654 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -141,6 +141,11 @@ class ZM_Object { global $object_cache; $object_cache[$class] = array(); } + public function _remove_from_cache($class, $object) { + global $object_cache; + unset($object_cache[$class][$object->Id()]); + Logger::Debug("Unsset $class " . $object->Id() . " " . count($object_cache[$class])); + } public static function Objects_Indexed_By_Id($class) { $results = array();