Skip to content
This repository
Browse code

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

…s (os6175)
  • Loading branch information...
commit aedadebae6146653f15ad593d0053a42ecd2f55c 1 parent 8ea2460
Mateusz U authored April 12, 2012

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  model/DataObject.php
14  model/DataObject.php
@@ -2652,8 +2652,13 @@ public function flushCache($persistent = true) {
2652 2652
 		}
2653 2653
 		
2654 2654
 		$this->extend('flushCache');
  2655
+		
  2656
+		$this->components = array();
2655 2657
 	}
2656 2658
 
  2659
+	/**
  2660
+	 * Flush the get_one global cache and destroy associated objects.
  2661
+	 */
2657 2662
 	static function flush_and_destroy_cache() {
2658 2663
 		if(self::$_cache_get_one) foreach(self::$_cache_get_one as $class => $items) {
2659 2664
 			if(is_array($items)) foreach($items as $item) {
@@ -2664,11 +2669,14 @@ static function flush_and_destroy_cache() {
2664 2669
 	}
2665 2670
 	
2666 2671
 	/**
2667  
-	 * Reset internal caches, for example after test runs
  2672
+	 * Reset all global caches associated with DataObject.
2668 2673
 	 */
2669 2674
 	static function reset() {
2670  
-		self::$cache_get_one = array();
2671  
-		self::$cache_buildSQL_query = array();
  2675
+		self::$cache_has_own_table = array();
  2676
+		self::$cache_has_own_table_field = array();
  2677
+		self::$_cache_get_one = array();
  2678
+		self::$_cache_composite_fields = array();
  2679
+		self::$_cache_get_class_ancestry = array();
2672 2680
 	}
2673 2681
 
2674 2682
 	/**

0 notes on commit aedadeb

Please sign in to comment.
Something went wrong with that request. Please try again.