3 declare(strict_types=1);
33 $this->entity = $a_entity;
44 $fields[
'meta_entity_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_entity'));
46 if ($this->db->insert(
'il_meta_entity', $fields)) {
55 return $this->
getMetaId() && $this->db->update(
58 array(
"meta_entity_id" => array(
'integer', $this->
getMetaId()))
62 public function delete():
bool 65 $query =
"DELETE FROM il_meta_entity " .
66 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
82 'rbac_id' => array(
'integer', $this->
getRBACId()),
83 'obj_id' => array(
'integer', $this->
getObjId()),
84 'obj_type' => array(
'text', $this->
getObjType()),
86 'parent_id' => array(
'integer', $this->
getParentId()),
87 'entity' => array(
'text', $this->
getEntity())
91 public function read(): bool
94 $query =
"SELECT * FROM il_meta_entity " .
95 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
100 $this->
setObjId((
int) $row->obj_id);
120 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
124 $ilDB = $DIC->database();
126 $query =
"SELECT meta_entity_id FROM il_meta_entity " .
127 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
128 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
129 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
130 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text') .
" " .
131 "ORDER BY meta_entity_id ";
136 $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)