3 declare(strict_types=1);
52 $ent->setMetaId($a_entity_id);
61 $ent->setParentType(
'meta_contribute');
67 public function setRole(
string $a_role): bool
76 case 'GraphicalDesigner':
77 case 'TechnicalImplementer':
78 case 'ContentProvider':
79 case 'TechnicalValidator':
80 case 'EducationalValidator':
82 case 'InstructionalDesigner':
83 case 'SubjectMatterExpert':
86 case 'PointOfContact':
87 $this->role = $a_role;
102 $this->date = $a_date;
113 $fields[
'meta_contribute_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_contribute'));
115 if ($this->db->insert(
'il_meta_contribute', $fields)) {
124 return $this->
getMetaId() && $this->db->update(
125 'il_meta_contribute',
127 array(
"meta_contribute_id" => array(
'integer', $this->
getMetaId()))
131 public function delete():
bool 134 $query =
"DELETE FROM il_meta_contribute " .
135 "WHERE meta_contribute_id = " . $this->db->quote($this->
getMetaId(),
'integer');
153 'rbac_id' => array(
'integer', $this->
getRBACId()),
154 'obj_id' => array(
'integer', $this->
getObjId()),
155 'obj_type' => array(
'text', $this->
getObjType()),
157 'parent_id' => array(
'integer', $this->
getParentId()),
158 'role' => array(
'text', $this->
getRole()),
159 'c_date' => array(
'text', $this->
getDate())
166 $query =
"SELECT * FROM il_meta_contribute " .
167 "WHERE meta_contribute_id = " . $this->db->quote($this->
getMetaId(),
'integer');
172 $this->
setObjId((
int) $row->obj_id);
176 $this->
setRole((
string) $row->role);
177 $this->
setDate((
string) $row->c_date);
186 'Role' => $this->
getRole() ?:
'Author' 191 foreach ($entities as
$id) {
193 $ent->toXML($writer);
195 if (!count($entities)) {
197 $ent->toXML($writer);
209 public static function _getIds(
int $a_rbac_id,
int $a_obj_id,
int $a_parent_id,
string $a_parent_type): array
213 $ilDB = $DIC[
'ilDB'];
215 $query =
"SELECT meta_contribute_id FROM il_meta_contribute " .
216 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
217 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
218 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
219 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
224 $ids[] = (
int) $row->meta_contribute_id;
232 public static function _lookupAuthors(
int $a_rbac_id,
int $a_obj_id,
string $a_obj_type): array
236 $ilDB = $DIC[
'ilDB'];
240 $query =
"SELECT entity,ent.parent_type,role FROM il_meta_entity ent " .
241 "JOIN il_meta_contribute con ON ent.parent_id = con.meta_contribute_id " .
242 "WHERE ent.rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
243 "AND ent.obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
246 if ($row->role ===
'Author' && $row->parent_type ===
'meta_contribute') {
247 $authors[] = trim($row->entity);
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
toXML(ilXmlWriter $writer)
xmlEndTag(string $tag)
Writes an endtag.
getEntity(int $a_entity_id)
static _lookupAuthors(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
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)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)