30 include_once
'class.ilMDBase.php';
38 $this->catalog = $a_catalog;
42 return $this->catalog;
46 $this->entry = $a_entry;
61 $fields[
'meta_identifier_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_identifier'));
63 if ($this->db->insert(
'il_meta_identifier', $fields)) {
77 if ($this->db->update(
80 array(
"meta_identifier_id" => array(
'integer',$this->
getMetaId()))
88 public function delete()
95 $query =
"DELETE FROM il_meta_identifier " .
96 "WHERE meta_identifier_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
106 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
107 'obj_id' => array(
'integer',$this->
getObjId()),
108 'obj_type' => array(
'text',$this->
getObjType()),
110 'parent_id' => array(
'integer',$this->
getParentId()),
111 'catalog' => array(
'text',$this->
getCatalog()),
112 'entry' => array(
'text',$this->
getEntry()));
119 $ilDB = $DIC[
'ilDB'];
122 $query =
"SELECT * FROM il_meta_identifier " .
123 "WHERE meta_identifier_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
144 public function toXML(&$writer, $a_overwrite_id =
false)
146 $entry_default = ($this->
getObjId() == 0)
154 $entry = $entry_default;
158 if (strlen($catalog)) {
159 $writer->xmlElement(
'Identifier', array(
'Catalog' => $catalog,
162 $writer->xmlElement(
'Identifier', array(
'Entry' => $entry));
168 public static function _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
172 $ilDB = $DIC[
'ilDB'];
174 $query =
"SELECT meta_identifier_id FROM il_meta_identifier " .
175 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
176 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
177 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
178 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
182 $ids[] =
$row->meta_identifier_id;
184 return $ids ? $ids : array();
197 $ilDB = $DIC[
'ilDB'];
199 $query =
"SELECT meta_identifier_id, catalog, entry FROM il_meta_identifier " .
200 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
201 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
202 "AND obj_type = " .
$ilDB->quote($a_obj_type,
'text');
207 $entries[
$r[
"meta_identifier_id"]] =
208 array(
"catalog" => $r[
"catalog"],
209 "entry" => $r[
"entry"]);
224 $ilDB = $DIC[
'ilDB'];
226 $query =
"SELECT meta_identifier_id, catalog, entry, obj_id FROM il_meta_identifier " .
227 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer');
229 if ($a_obj_type !=
"") {
231 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text');
237 $entries[
$r[
"meta_identifier_id"]] =
238 array(
"catalog" => $r[
"catalog"],
239 "entry" => $r[
"entry"],
240 "obj_id" => $r[
"obj_id"]);
255 $ilDB = $DIC[
'ilDB'];
257 $query =
"SELECT meta_identifier_id, obj_id FROM il_meta_identifier " .
258 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
259 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text') .
260 " AND catalog = " .
$ilDB->quote($a_catalog,
'text') .
261 " AND entry = " .
$ilDB->quote($a_entry,
'text');
275 public static function readIdData($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
279 $ilDB = $DIC[
'ilDB'];
281 $query =
"SELECT * FROM il_meta_identifier " .
282 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
283 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text') .
284 " AND catalog = " .
$ilDB->quote($a_catalog,
'text') .
285 " AND entry = " .
$ilDB->quote($a_entry,
'text');
toXML(&$writer, $a_overwrite_id=false)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
static existsIdInRbacObject($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
static _getEntriesForObj($a_rbac_id, $a_obj_id, $a_obj_type)
Get IDs for an object.
static readIdData($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
setParentType($a_parent_type)
static _getEntriesForRbacObj($a_rbac_id, $a_obj_type="")
Get IDs for an rbac object.