31 include_once
'class.ilMDBase.php';
35 function ilMDRelation($a_rbac_id = 0,$a_obj_id = 0,$a_obj_type =
'')
46 include_once
'Services/MetaData/classes/class.ilMDIdentifier_.php';
52 include_once
'Services/MetaData/classes/class.ilMDIdentifier_.php';
54 if(!$a_identifier__id)
59 $ide->setMetaId($a_identifier__id);
65 include_once
'Services/MetaData/classes/class.ilMDIdentifier_.php';
69 $ide->setParentType(
'meta_relation');
76 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
82 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
84 if(!$a_description_id)
89 $des->setMetaId($a_description_id);
95 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
99 $des->setParentType(
'meta_relation');
115 case 'IsReferencedBy':
120 $this->kind = $a_kind;
138 $fields[
'meta_relation_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_relation'));
140 if($this->db->insert(
'il_meta_relation',$fields))
154 if($this->db->update(
'il_meta_relation',
155 $this->__getFields(),
156 array(
"meta_relation_id" => array(
'integer',$this->
getMetaId()))))
170 $query =
"DELETE FROM il_meta_relation ".
171 "WHERE meta_relation_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
193 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
194 'obj_id' => array(
'integer',$this->
getObjId()),
195 'obj_type' => array(
'text',$this->
getObjType()),
196 'kind' => array(
'text',$this->
getKind()));
205 $query =
"SELECT * FROM il_meta_relation ".
206 "WHERE meta_relation_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
227 $writer->xmlStartTag(
'Relation',array(
'Kind' => $this->
getKind()
230 $writer->xmlStartTag(
'Resource');
234 foreach($ides as $id)
237 $ide->toXML($writer);
241 include_once
'Services/MetaData/classes/class.ilMDIdentifier_.php';
243 $ide->toXML($writer);
248 foreach($dess as $id)
251 $des->toXML($writer);
255 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
257 $des->toXML($writer);
260 $writer->xmlEndTag(
'Resource');
261 $writer->xmlEndTag(
'Relation');
271 $query =
"SELECT meta_relation_id FROM il_meta_relation ".
272 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
273 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
278 $ids[] =
$row->meta_relation_id;
280 return $ids ? $ids : array();