mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
add new method SeedDMS_Core_Document::hasCategory()
This commit is contained in:
parent
61a5dbc2b9
commit
bc50f2f8b6
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user