32 include_once
'class.ilMDBase.php';
36 function ilMDEntity($a_rbac_id = 0,$a_obj_id = 0,$a_obj_type =
'')
46 $this->entity = $a_entity;
58 $fields[
'meta_entity_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_entity'));
60 if($this->db->insert(
'il_meta_entity',$fields))
74 if($this->db->update(
'il_meta_entity',
76 array(
"meta_entity_id" => array(
'integer',$this->
getMetaId()))))
90 $query =
"DELETE FROM il_meta_entity ".
91 "WHERE meta_entity_id = ".$ilDB->quote($this->
getMetaId(),
'integer');
104 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
105 'obj_id' => array(
'integer',$this->
getObjId()),
106 'obj_type' => array(
'text',$this->
getObjType()),
108 'parent_id' => array(
'integer',$this->
getParentId()),
109 'entity' => array(
'text',$this->
getEntity()));
118 $query =
"SELECT * FROM il_meta_entity ".
119 "WHERE meta_entity_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
142 $writer->xmlElement(
'Entity',null,$this->
getEntity());
147 function _getIds($a_rbac_id,$a_obj_id,$a_parent_id,$a_parent_type)
151 $query =
"SELECT meta_entity_id FROM il_meta_entity ".
152 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
153 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
154 "AND parent_id = ".$ilDB->quote($a_parent_id ,
'integer').
" ".
155 "AND parent_type = ".$ilDB->quote($a_parent_type ,
'text').
" ".
156 "ORDER BY meta_entity_id ";
161 $ids[] =
$row->meta_entity_id;
163 return $ids ? $ids : array();