hasDocuments() doesn't use internal cache anymore

This commit is contained in:
Uwe Steinmann 2021-09-24 10:20:19 +02:00
parent 3cf58fbc86
commit 8e302bc770

View File

@ -825,10 +825,12 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
*/
function hasDocuments() { /* {{{ */
$db = $this->_dms->getDB();
/* Do not use the cache because it may not contain all documents if
* the former call getDocuments() limited the number of documents
if (isset($this->_documents)) {
/** @noinspection PhpUndefinedFieldInspection */
return count($this->_documents);
}
*/
$queryStr = "SELECT count(*) as c FROM `tblDocuments` WHERE `folder` = " . $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)