32 include_once
'class.ilMDBase.php';
36 function ilMDEntity($a_rbac_id = 0,$a_obj_id = 0,$a_obj_type =
'')
38 parent::ilMDBase($a_rbac_id,
46 $this->entity = $a_entity;
55 if($this->db->autoExecute(
'il_meta_entity',
59 $this->
setMetaId($this->db->getLastInsertId());
72 if($this->db->autoExecute(
'il_meta_entity',
75 "meta_entity_id = ".$ilDB->quote($this->
getMetaId())))
89 $query =
"DELETE FROM il_meta_entity ".
90 "WHERE meta_entity_id = ".$ilDB->quote($this->
getMetaId());
102 return array(
'rbac_id' => $this->
getRBACId(),
116 $query =
"SELECT * FROM il_meta_entity ".
117 "WHERE meta_entity_id = ".$ilDB->quote($this->
getMetaId());
140 $writer->xmlElement(
'Entity',null,$this->
getEntity());
145 function _getIds($a_rbac_id,$a_obj_id,$a_parent_id,$a_parent_type)
149 $query =
"SELECT meta_entity_id FROM il_meta_entity ".
150 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id).
" ".
151 "AND obj_id = ".$ilDB->quote($a_obj_id).
" ".
152 "AND parent_id = ".$ilDB->quote($a_parent_id).
" ".
153 "AND parent_type = ".$ilDB->quote($a_parent_type);
158 $ids[] =
$row->meta_entity_id;
160 return $ids ? $ids : array();
const DB_FETCHMODE_OBJECT
setMetaId($a_meta_id, $a_read_data=true)
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
setParentType($a_parent_type)
ilMDEntity($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')