3 declare(strict_types=1);
34 $this->catalog = $a_catalog;
42 public function setEntry(
string $a_entry): void
44 $this->entry = $a_entry;
55 $fields[
'meta_identifier_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_identifier'));
57 if ($this->db->insert(
'il_meta_identifier', $fields)) {
66 return $this->
getMetaId() && $this->db->update(
69 array(
"meta_identifier_id" => array(
'integer', $this->
getMetaId()))
73 public function delete():
bool 76 $query =
"DELETE FROM il_meta_identifier " .
77 "WHERE meta_identifier_id = " . $this->db->quote($this->
getMetaId(),
'integer');
90 'rbac_id' => array(
'integer', $this->
getRBACId()),
91 'obj_id' => array(
'integer', $this->
getObjId()),
92 'obj_type' => array(
'text', $this->
getObjType()),
94 'parent_id' => array(
'integer', $this->
getParentId()),
95 'catalog' => array(
'text', $this->
getCatalog()),
96 'entry' => array(
'text', $this->
getEntry())
103 $query =
"SELECT * FROM il_meta_identifier " .
104 "WHERE meta_identifier_id = " . $this->db->quote($this->
getMetaId(),
'integer');
109 $this->
setObjId((
int) $row->obj_id);
122 $entry_default = ($this->
getObjId() === 0)
126 $entry = $this->
getEntry() ?: $entry_default;
130 $entry = $entry_default;
134 if ($catalog !==
'') {
136 'Catalog' => $catalog,
140 $writer->
xmlElement(
'Identifier', array(
'Entry' => $entry));
149 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
153 $ilDB = $DIC->database();
155 $query =
"SELECT meta_identifier_id FROM il_meta_identifier " .
156 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
157 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
158 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
159 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
164 $ids[] = (
int) $row->meta_identifier_id;
172 public static function _getEntriesForObj(
int $a_rbac_id,
int $a_obj_id,
string $a_obj_type): array
176 $ilDB = $DIC->database();
178 $query =
"SELECT meta_identifier_id, catalog, entry FROM il_meta_identifier " .
179 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
180 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
181 "AND obj_type = " .
$ilDB->quote($a_obj_type,
'text');
186 $entries[$r[
"meta_identifier_id"]] =
188 "catalog" => $r[
"catalog"],
189 "entry" => $r[
"entry"]
202 $ilDB = $DIC->database();
204 $query =
"SELECT meta_identifier_id, catalog, entry, obj_id FROM il_meta_identifier " .
205 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer');
207 if ($a_obj_type !==
"") {
209 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text');
215 $entries[$r[
"meta_identifier_id"]] =
217 "catalog" => $r[
"catalog"],
218 "entry" => $r[
"entry"],
219 "obj_id" => $r[
"obj_id"]
233 $ilDB = $DIC->database();
235 $query =
"SELECT meta_identifier_id, obj_id FROM il_meta_identifier " .
236 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
237 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text') .
238 " AND catalog = " .
$ilDB->quote($a_catalog,
'text') .
239 " AND entry = " .
$ilDB->quote($a_entry,
'text');
241 if ($r =
$ilDB->fetchAssoc($s)) {
250 public static function readIdData(
int $a_rbac_id,
string $a_obj_type,
string $a_catalog,
string $a_entry): array
254 $ilDB = $DIC->database();
256 $query =
"SELECT * FROM il_meta_identifier " .
257 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
258 " AND obj_type = " .
$ilDB->quote($a_obj_type,
'text') .
259 " AND catalog = " .
$ilDB->quote($a_catalog,
'text') .
260 " AND entry = " .
$ilDB->quote($a_entry,
'text');
263 while ($r =
$ilDB->fetchAssoc($s)) {
static readIdData(int $a_rbac_id, string $a_obj_type, string $a_catalog, string $a_entry)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static existsIdInRbacObject(int $a_rbac_id, string $a_obj_type, string $a_catalog, string $a_entry)
toXML(ilXmlWriter $writer)
setEntry(string $a_entry)
static _getEntriesForObj(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
setParentType(string $a_parent_type)
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setMetaId(int $a_meta_id, bool $a_read_data=true)
static _getEntriesForRbacObj(int $a_rbac_id, string $a_obj_type="")
setObjType(string $a_type)
setCatalog(string $a_catalog)