From 6178ca832012302c57b0b77e9cf53f6c814658e8 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 30 Jun 2016 12:07:33 +0200 Subject: [PATCH] DbObject: allow to clear all caches --- library/Director/Data/Db/DbObject.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index 5af989d2..b3a94824 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -1075,6 +1075,13 @@ abstract class DbObject unset(self::$prefetchStats[$class]); } + public static function clearAllPrefetchCaches() + { + self::$prefetched = array(); + self::$prefetchedNames = array(); + self::$prefetchStats = array(); + } + public static function exists($id, DbConnection $connection) { if (static::getPrefetched($id)) {