19 declare(strict_types=1);
35 $this->entity = $a_entity;
46 $fields[
'meta_entity_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_entity'));
48 if ($this->db->insert(
'il_meta_entity', $fields)) {
57 return $this->
getMetaId() && $this->db->update(
60 array(
"meta_entity_id" => array(
'integer', $this->
getMetaId()))
64 public function delete():
bool 67 $query =
"DELETE FROM il_meta_entity " .
68 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
69 $res = $this->db->manipulate($query);
71 $this->db->query($query);
84 'rbac_id' => array(
'integer', $this->
getRBACId()),
85 'obj_id' => array(
'integer', $this->
getObjId()),
86 'obj_type' => array(
'text', $this->
getObjType()),
88 'parent_id' => array(
'integer', $this->
getParentId()),
89 'entity' => array(
'text', $this->
getEntity())
93 public function read(): bool
96 $query =
"SELECT * FROM il_meta_entity " .
97 "WHERE meta_entity_id = " . $this->db->quote($this->
getMetaId(),
'integer');
99 $res = $this->db->query($query);
102 $this->
setObjId((
int) $row->obj_id);
122 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
126 $ilDB = $DIC->database();
128 $query =
"SELECT meta_entity_id FROM il_meta_entity " .
129 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
130 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
131 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
132 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text') .
" " .
133 "ORDER BY meta_entity_id ";
138 $ids[] = (
int) $row->meta_entity_id;
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)