[icinga-checkins] icinga.org: icingaweb2-module-director/master: DbObject: allow to clear all caches

git at icinga.org git at icinga.org
Thu Jun 30 12:18:21 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 6178ca832012302c57b0b77e9cf53f6c814658e8
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=6178ca832012302c57b0b77e9cf53f6c814658e8

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Jun 30 12:07:33 2016 +0200

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 5af989d..b3a9482 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)) {



More information about the icinga-checkins mailing list