19 declare(strict_types=1);
34 $this->entity = $a_entity;
45 $fields[
'meta_entity_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_entity'));
47 if ($this->db->insert(
'il_meta_entity', $fields)) {
56 return $this->
getMetaId() && $this->db->update(
59 array(
"meta_entity_id" => array(
'integer', $this->
getMetaId()))
63 public function delete():
bool 66 $query =
"DELETE FROM il_meta_entity " .
67 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
68 $res = $this->db->manipulate($query);
70 $this->db->query($query);
83 'rbac_id' => array(
'integer', $this->
getRBACId()),
84 'obj_id' => array(
'integer', $this->
getObjId()),
85 'obj_type' => array(
'text', $this->
getObjType()),
87 'parent_id' => array(
'integer', $this->
getParentId()),
88 'entity' => array(
'text', $this->
getEntity())
92 public function read(): bool
95 $query =
"SELECT * FROM il_meta_entity " .
96 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
98 $res = $this->db->query($query);
101 $this->
setObjId((
int) $row->obj_id);
121 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
125 $ilDB = $DIC->database();
127 $query =
"SELECT meta_entity_id FROM il_meta_entity " .
128 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
129 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
130 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
131 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text') .
" " .
132 "ORDER BY meta_entity_id ";
137 $ids[] = (
int) $row->meta_entity_id;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEntity(string $a_entity)
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)
setObjType(string $a_type)
toXML(ilXmlWriter $writer)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)