mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-29 02:50:39 +00:00
getAttributeDefinitions() returns sequence and show
This commit is contained in:
parent
41f771a796
commit
0a057448b9
|
|
@ -1219,11 +1219,19 @@ class SeedDMS_Core_AttributeDefinitionGroup { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get all attribute defintions of a group
|
||||
*
|
||||
* @param mixed $objtype single object type or list of object types
|
||||
* @return array list of attribute definitions, its sequence and show
|
||||
* value. This is an array of array with the keys 'attrdef', 'sequence'
|
||||
* and 'show'
|
||||
*/
|
||||
function getAttributeDefinitions($objtype=array()) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
if (!isset($this->_attrdefs)) {
|
||||
$queryStr = "SELECT `tblAttributeDefinitions`.* FROM `tblAttributeDefinitions` ".
|
||||
$queryStr = "SELECT `tblAttributeDefinitions`.*, `tblAttributeDefinitionGroupAttributeDefinition`.* FROM `tblAttributeDefinitions` ".
|
||||
"LEFT JOIN `tblAttributeDefinitionGroupAttributeDefinition` ON `tblAttributeDefinitionGroupAttributeDefinition`.`attrdef`=`tblAttributeDefinitions`.`id` ".
|
||||
"WHERE `tblAttributeDefinitionGroupAttributeDefinition`.`attrgrp` = '". $this->_id ."' ";
|
||||
if($objtype) {
|
||||
|
|
@ -1242,7 +1250,7 @@ class SeedDMS_Core_AttributeDefinitionGroup { /* {{{ */
|
|||
foreach ($resArr as $row) {
|
||||
$attrdef = new SeedDMS_Core_AttributeDefinition($row["id"], $row["name"], $row["objtype"], $row["type"], $row["multiple"], $row["minvalues"], $row["maxvalues"], $row["valueset"], $row["regex"]);
|
||||
$attrdef->setDMS($this->_dms);
|
||||
array_push($this->_attrdefs, $attrdef);
|
||||
array_push($this->_attrdefs, array('attrdef'=>$attrdef, 'sequence'=>$row['sequence'], 'show'=>$row['show']));
|
||||
}
|
||||
}
|
||||
return $this->_attrdefs;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user