add new method SeedDMS_Core_Document::hasCategory()

This commit is contained in:
Uwe Steinmann 2021-06-25 09:34:54 +02:00
parent 61a5dbc2b9
commit bc50f2f8b6
2 changed files with 21 additions and 0 deletions

View File

@ -429,6 +429,26 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
return true;
} /* }}} */
/**
* Check if document has a given category
*
* @param SeedDMS_Core_DocumentCategory $cat
* @return bool true if document has category, otherwise false
*/
function hasCategory($cat) { /* {{{ */
$db = $this->_dms->getDB();
if(!$cat)
return false;
$queryStr = "SELECT * FROM `tblDocumentCategory` WHERE `documentID` = ".$this->_id." AND `categoryID`=".$cat->getId();
$resArr = $db->getResultArray($queryStr);
if (!$resArr)
return false;
return true;
} /* }}} */
/**
* Retrieve a list of all categories this document belongs to
*

View File

@ -29,6 +29,7 @@
- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog()
- better handling of document with an empty workflow state
- fix checking of email addresses by using filter_var instead of regex
- add new method SeedDMS_Core_Document::hasCategory()
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">