30 include_once
'class.ilMDBase.php';
45 $this->catalog = $a_catalog;
49 return $this->catalog;
53 $this->entry = $a_entry;
66 $fields[
'meta_identifier_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_identifier'));
68 if($this->db->insert(
'il_meta_identifier',$fields))
82 if($this->db->update(
'il_meta_identifier',
84 array(
"meta_identifier_id" => array(
'integer',$this->
getMetaId()))))
98 $query =
"DELETE FROM il_meta_identifier ".
99 "WHERE meta_identifier_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
109 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
110 'obj_id' => array(
'integer',$this->
getObjId()),
111 'obj_type' => array(
'text',$this->
getObjType()),
113 'parent_id' => array(
'integer',$this->
getParentId()),
114 'catalog' => array(
'text',$this->
getCatalog()),
115 'entry' => array(
'text',$this->
getEntry()));
125 $query =
"SELECT * FROM il_meta_identifier ".
126 "WHERE meta_identifier_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
148 function toXML(&$writer, $a_overwrite_id =
false)
150 $entry_default = ($this->
getObjId() == 0)
151 ?
"il_".IL_INST_ID.
"_".$this->getObjType().
"_".$this->
getRBACId()
159 $entry = $entry_default;
165 $writer->xmlElement(
'Identifier',array(
'Catalog' => $catalog,
170 $writer->xmlElement(
'Identifier',array(
'Entry' => $entry));
176 function _getIds($a_rbac_id,$a_obj_id,$a_parent_id,$a_parent_type)
180 $query =
"SELECT meta_identifier_id FROM il_meta_identifier ".
181 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
182 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
183 "AND parent_id = ".$ilDB->quote($a_parent_id ,
'integer').
" ".
184 "AND parent_type = ".$ilDB->quote($a_parent_type ,
'text');
189 $ids[] =
$row->meta_identifier_id;
191 return $ids ? $ids : array();
204 $query =
"SELECT meta_identifier_id, catalog, entry FROM il_meta_identifier ".
205 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
206 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
207 "AND obj_type = ".$ilDB->quote($a_obj_type ,
'text');
211 while($r = $ilDB->fetchAssoc(
$res))
213 $entries[$r[
"meta_identifier_id"]] =
214 array(
"catalog" => $r[
"catalog"],
215 "entry" => $r[
"entry"]);
230 $query =
"SELECT meta_identifier_id, catalog, entry, obj_id FROM il_meta_identifier ".
231 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer');
233 if ($a_obj_type !=
"")
236 " AND obj_type = ".$ilDB->quote($a_obj_type ,
'text');
241 while($r = $ilDB->fetchAssoc(
$res))
243 $entries[$r[
"meta_identifier_id"]] =
244 array(
"catalog" => $r[
"catalog"],
245 "entry" => $r[
"entry"],
246 "obj_id" => $r[
"obj_id"]);
261 $query =
"SELECT meta_identifier_id, obj_id FROM il_meta_identifier ".
262 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
263 " AND obj_type = ".$ilDB->quote($a_obj_type ,
'text').
264 " AND catalog = ".$ilDB->quote($a_catalog ,
'text').
265 " AND entry = ".$ilDB->quote($a_entry ,
'text');
266 $s = $ilDB->query(
$query);
267 if ($r = $ilDB->fetchAssoc($s))
280 static public function readIdData($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
284 $query =
"SELECT * FROM il_meta_identifier ".
285 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
286 " AND obj_type = ".$ilDB->quote($a_obj_type ,
'text').
287 " AND catalog = ".$ilDB->quote($a_catalog ,
'text').
288 " AND entry = ".$ilDB->quote($a_entry ,
'text');
289 $s = $ilDB->query(
$query);
291 while ($r = $ilDB->fetchAssoc($s))