31 include_once
'class.ilMDBase.php';
35 function ilMDRelation($a_rbac_id = 0,$a_obj_id = 0,$a_obj_type =
'')
46 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier_.php';
52 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier_.php';
54 if(!$a_identifier__id)
59 $ide->setMetaId($a_identifier__id);
65 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier_.php';
69 $ide->setParentType(
'meta_relation');
76 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
82 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
84 if(!$a_description_id)
89 $des->setMetaId($a_description_id);
95 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
99 $des->setParentType(
'meta_relation');
115 case 'IsReferencedBy':
120 $this->kind = $a_kind;
135 if($this->db->autoExecute(
'il_meta_relation',
136 $this->__getFields(),
137 DB_AUTOQUERY_INSERT))
139 $this->
setMetaId($this->db->getLastInsertId());
152 if($this->db->autoExecute(
'il_meta_relation',
153 $this->__getFields(),
155 "meta_relation_id = ".$ilDB->quote($this->
getMetaId())))
169 $query =
"DELETE FROM il_meta_relation ".
170 "WHERE meta_relation_id = ".$ilDB->quote($this->
getMetaId());
193 return array(
'rbac_id' => $this->
getRBACId(),
205 $query =
"SELECT * FROM il_meta_relation ".
206 "WHERE meta_relation_id = ".$ilDB->quote($this->
getMetaId());
227 $writer->xmlStartTag(
'Relation',array(
'Kind' => $this->
getKind()));
228 $writer->xmlStartTag(
'Resource');
234 $ide->toXML($writer);
240 $des->toXML($writer);
242 $writer->xmlEndTag(
'Resource');
243 $writer->xmlEndTag(
'Relation');
253 $query =
"SELECT meta_relation_id FROM il_meta_relation ".
254 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id).
" ".
255 "AND obj_id = ".$ilDB->quote($a_obj_id);
260 $ids[] =
$row->meta_relation_id;
262 return $ids ? $ids : array();