36 $this->db = $DIC->database();
45 protected function setObjId(
int $a_obj_id): void
47 $this->obj_id = $a_obj_id;
74 $this->profiles[$a_profile_id] = [
75 "profile_id" => $a_profile_id
81 unset($this->profiles[$a_profile_id]);
89 protected function read(): void
95 "SELECT spr.profile_id, spr.role_id, sp.title, sp.skill_tree_id " .
96 " FROM skl_profile_role spr INNER JOIN skl_profile sp ON spr.profile_id = sp.id " .
97 " WHERE sp.ref_id = 0 " .
98 " AND role_id = " . $db->
quote($this->getMemberRoleId(),
"integer")
101 $this->profiles[$rec[
"profile_id"]] = $rec;
105 protected function delete():
void 110 "DELETE spr FROM skl_profile_role spr INNER JOIN skl_profile sp " .
111 " ON spr.profile_id = sp.id " .
112 " WHERE sp.ref_id = 0 " .
113 " AND role_id = " . $db->
quote($this->getMemberRoleId(),
"integer")
122 foreach ($this->profiles as $p) {
123 $db->
manipulate(
"INSERT INTO skl_profile_role " .
124 "(role_id, profile_id) VALUES (" .
125 $db->
quote($this->getMemberRoleId(),
"integer") .
"," .
126 $db->
quote($p[
"profile_id"],
"integer") .
")");
addProfile(int $a_profile_id)
fetchAssoc(ilDBStatement $statement)
static _getAllReferences(int $id)
get all reference ids for object ID
quote($value, string $type)
static getDefaultMemberRole(int $a_ref_id)
removeProfile(int $a_profile_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_obj_id)
query(string $query)
Run a (read-only) Query on the database.
manipulate(string $query)
Run a (write) Query on the database.