diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 96d982680..d883d33d6 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -220,6 +220,27 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ $this->_notifyList = array(); $this->_latestContent = null; $this->_content = null; + /* Cache */ + $this->clearCache(); + } /* }}} */ + + /** + * Clear cache of this instance. + * + * The result of some expensive database actions (e.g. get all subfolders + * or documents) will be saved in a class variable to speed up consecutive + * calls of the same method. If a second call of the same method shall not + * use the cache, then it must be cleared. + * + */ + public function clearCache() { /* {{{ */ + $this->_parent = null; + $this->_owner = null; + $this->_documentLinks = null; + $this->_documentFiles = null; + $this->_content = null; + $this->_accessList = null; + $this->_notifyList = null; } /* }}} */ /**