3 declare(strict_types=1);
42 if (!$a_identifier__id) {
46 $ide->setMetaId($a_identifier__id);
55 $ide->setParentType(
'meta_relation');
70 if (!$a_description_id) {
74 $des->setMetaId($a_description_id);
83 $des->setParentType(
'meta_relation');
89 public function setKind(
string $a_kind): bool
99 case 'IsReferencedBy':
104 $this->kind = $a_kind;
120 $fields[
'meta_relation_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_relation'));
122 if ($this->db->insert(
'il_meta_relation', $fields)) {
131 return $this->
getMetaId() && $this->db->update(
134 array(
"meta_relation_id" => array(
'integer', $this->
getMetaId()))
138 public function delete():
bool 141 $query =
"DELETE FROM il_meta_relation " .
142 "WHERE meta_relation_id = " . $this->db->quote($this->
getMetaId(),
'integer');
165 'rbac_id' => array(
'integer', $this->
getRBACId()),
166 'obj_id' => array(
'integer', $this->
getObjId()),
167 'obj_type' => array(
'text', $this->
getObjType()),
168 'kind' => array(
'text', $this->
getKind())
175 $query =
"SELECT * FROM il_meta_relation " .
176 "WHERE meta_relation_id = " . $this->db->quote($this->
getMetaId(),
'integer');
181 $this->
setObjId((
int) $row->obj_id);
183 $this->
setKind($row->kind ??
'');
192 'Kind' => $this->
getKind() ?:
'IsPartOf' 198 foreach ($ides as
$id) {
200 $ide->toXML($writer);
204 $ide->toXML($writer);
209 foreach ($dess as $id) {
211 $des->toXML($writer);
215 $des->toXML($writer);
227 public static function _getIds(
int $a_rbac_id,
int $a_obj_id): array
231 $ilDB = $DIC->database();
233 $query =
"SELECT meta_relation_id FROM il_meta_relation " .
234 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
235 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
240 $ids[] = (
int) $row->meta_relation_id;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDescription(int $a_description_id)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
xmlEndTag(string $tag)
Writes an endtag.
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
getIdentifier_(int $a_identifier__id)
toXML(ilXmlWriter $writer)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
setMetaId(int $a_meta_id, bool $a_read_data=true)
static _getIds(int $a_rbac_id, int $a_obj_id)
setObjType(string $a_type)