3 declare(strict_types=1);
28 protected \ilDBInterface
$db;
37 $this->db = (
$db) ?: $DIC->database();
38 $this->factory_service = (
$factory_service) ?: $DIC->skills()->internal()->factory();
46 "DELETE FROM skl_profile_role WHERE " .
47 " profile_id = " .
$ilDB->quote($profile_id,
"integer")
51 public function get(
int $profile_id): array
56 "SELECT * FROM skl_profile_role " .
57 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
60 while ($rec =
$ilDB->fetchAssoc($set)) {
69 return $this->factory_service->profile()->profileRoleAssignment(
84 array(
"profile_id" => array(
"integer", $profile_id),
85 "role_id" => array(
"integer", $role_id),
96 "DELETE FROM skl_profile_role WHERE " .
97 " profile_id = " .
$ilDB->quote($profile_id,
"integer") .
98 " AND role_id = " .
$ilDB->quote($role_id,
"integer")
107 "DELETE FROM skl_profile_role WHERE " .
108 " role_id = " .
$ilDB->quote($role_id,
"integer")
121 "SELECT spr.profile_id, spr.role_id, sp.title, sp.description, sp.ref_id, sp.skill_tree_id, sp.image_id " .
122 " FROM skl_profile_role spr INNER JOIN skl_profile sp ON (spr.profile_id = sp.id) " .
123 " WHERE spr.role_id = " .
$ilDB->quote($role_id,
"integer") .
124 " ORDER BY sp.title ASC" 126 while ($rec =
$ilDB->fetchAssoc($set)) {
141 "SELECT spr.profile_id, spr.role_id, sp.title, sp.description, sp.ref_id, sp.skill_tree_id, sp.image_id " .
142 " FROM skl_profile_role spr INNER JOIN skl_profile sp ON (spr.profile_id = sp.id) " .
143 " WHERE spr.role_id = " .
$ilDB->quote($role_id,
"integer") .
144 " AND sp.ref_id = 0" .
145 " ORDER BY sp.title ASC" 147 while ($rec =
$ilDB->fetchAssoc($set)) {
163 "SELECT spr.profile_id, spr.role_id, sp.title, sp.description, sp.ref_id, sp.skill_tree_id, sp.image_id " .
164 " FROM skl_profile_role spr INNER JOIN skl_profile sp ON (spr.profile_id = sp.id) " .
165 " WHERE spr.role_id = " .
$ilDB->quote($role_id,
"integer") .
166 " AND sp.ref_id <> 0" .
167 " ORDER BY sp.title ASC" 169 while ($rec =
$ilDB->fetchAssoc($set)) {
177 $rec[
"id"] = (
int) $rec[
"id"];
178 $rec[
"title"] = (string) $rec[
"title"];
179 $rec[
"description"] = (string) $rec[
"description"];
180 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
181 $rec[
"image_id"] = (string) $rec[
"image_id"];
182 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
184 return $this->factory_service->profile()->profile(
188 $rec[
"skill_tree_id"],
196 $rec[
"role_id"] = (
int) $rec[
"role_id"];
197 $rec[
"profile_id"] = (
int) $rec[
"profile_id"];
198 $rec[
"title"] = (string) $rec[
"title"];
199 $rec[
"description"] = (string) $rec[
"description"];
200 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
201 $rec[
"image_id"] = (string) $rec[
"image_id"];
202 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
204 return $this->factory_service->profile()->roleProfile(
209 $rec[
"skill_tree_id"],
220 "SELECT count(*) rcnt FROM skl_profile_role " .
221 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
223 $rec =
$ilDB->fetchAssoc($set);
224 return (
int) $rec[
"rcnt"];
getRoleAssignmentFromRecord(array $rec)
getRoleProfileFromRecord(array $rec)
addRoleToProfile(int $profile_id, int $role_id)
Service SkillInternalFactoryService $factory_service
getLocalProfilesOfRole(int $role_id)
__construct(\ilDBInterface $db=null, Service\SkillInternalFactoryService $factory_service=null)
getAllProfilesOfRole(int $role_id)
deleteProfileRoles(int $profile_id)
Skill internal factory service.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getProfileFromRecord(array $rec)
removeRoleFromAllProfiles(int $role_id)
removeRoleFromProfile(int $profile_id, int $role_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getGlobalProfilesOfRole(int $role_id)
countRoles(int $profile_id)