Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: adjust the cache flush and reset functions to cover all cache…

…s (os6175)
  • Loading branch information...
commit aedadebae6146653f15ad593d0053a42ecd2f55c 1 parent 8ea2460
@mateusz mateusz authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 model/DataObject.php
View
14 model/DataObject.php
@@ -2652,8 +2652,13 @@ public function flushCache($persistent = true) {
}
$this->extend('flushCache');
+
+ $this->components = array();
}
+ /**
+ * Flush the get_one global cache and destroy associated objects.
+ */
static function flush_and_destroy_cache() {
if(self::$_cache_get_one) foreach(self::$_cache_get_one as $class => $items) {
if(is_array($items)) foreach($items as $item) {
@@ -2664,11 +2669,14 @@ static function flush_and_destroy_cache() {
}
/**
- * Reset internal caches, for example after test runs
+ * Reset all global caches associated with DataObject.
*/
static function reset() {
- self::$cache_get_one = array();
- self::$cache_buildSQL_query = array();
+ self::$cache_has_own_table = array();
+ self::$cache_has_own_table_field = array();
+ self::$_cache_get_one = array();
+ self::$_cache_composite_fields = array();
+ self::$_cache_get_class_ancestry = array();
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.