mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
SeedDMS_Core_DMS::getAllAttributeDefinitions() has second parameter to filter attributes by type
This commit is contained in:
parent
55126a689b
commit
f718f565ff
|
@ -2640,17 +2640,30 @@ class SeedDMS_Core_DMS {
|
|||
/**
|
||||
* Return list of all attributes definitions
|
||||
*
|
||||
* @param integer $objtype select those attributes defined for an object type
|
||||
* @param integer|array $objtype select those attributes defined for an object type
|
||||
* @param integer|array $type select those attributes defined for a type
|
||||
* @return bool|SeedDMS_Core_AttributeDefinition[] of instances of <a href='psi_element://SeedDMS_Core_AttributeDefinition'>SeedDMS_Core_AttributeDefinition</a> or false
|
||||
* or false
|
||||
*/
|
||||
function getAllAttributeDefinitions($objtype=0) { /* {{{ */
|
||||
function getAllAttributeDefinitions($objtype=0, $type=0) { /* {{{ */
|
||||
$queryStr = "SELECT * FROM `tblAttributeDefinitions`";
|
||||
if($objtype) {
|
||||
if(is_array($objtype))
|
||||
$queryStr .= ' WHERE `objtype` in (\''.implode("','", $objtype).'\')';
|
||||
else
|
||||
$queryStr .= ' WHERE `objtype`='.intval($objtype);
|
||||
if($objtype || $type) {
|
||||
$queryStr .= ' WHERE ';
|
||||
if($objtype) {
|
||||
if(is_array($objtype))
|
||||
$queryStr .= '`objtype` in (\''.implode("','", $objtype).'\')';
|
||||
else
|
||||
$queryStr .= '`objtype`='.intval($objtype);
|
||||
}
|
||||
if($objtype && $type) {
|
||||
$queryStr .= ' AND ';
|
||||
}
|
||||
if($type) {
|
||||
if(is_array($type))
|
||||
$queryStr .= '`type` in (\''.implode("','", $type).'\')';
|
||||
else
|
||||
$queryStr .= '`type`='.intval($type);
|
||||
}
|
||||
}
|
||||
$queryStr .= ' ORDER BY `name`';
|
||||
$resArr = $this->db->getResultArray($queryStr);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
- add more types to getStatisticalData()
|
||||
- add optional parameter $op to SeedDMS_Core_AttributeDefinition::getObjects()
|
||||
- SeedDMS_Core_AttributeDefinition::getObjects() will not filter by value if null is passed
|
||||
- SeedDMS_Core_DMS::getAllAttributeDefinitions() has second parameter to filter attributes by type
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user