add method clearCache()

This commit is contained in:
Uwe Steinmann 2021-09-24 10:05:00 +02:00
parent fbe13a87f1
commit ada7c1d692

View File

@ -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;
} /* }}} */
/**