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();
41 public function get(
int $profile_id): array
46 "SELECT * FROM skl_profile_user " .
47 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
50 while ($rec =
$ilDB->fetchAssoc($set)) {
59 return $this->factory_service->profile()->profileUserAssignment(
71 array(
"profile_id" => array(
"integer", $profile_id),
72 "user_id" => array(
"integer", $user_id),
83 "DELETE FROM skl_profile_user WHERE " .
84 " profile_id = " .
$ilDB->quote($profile_id,
"integer") .
85 " AND user_id = " .
$ilDB->quote($user_id,
"integer")
94 "DELETE FROM skl_profile_user WHERE " .
95 " user_id = " .
$ilDB->quote($user_id,
"integer")
104 "DELETE FROM skl_profile_user WHERE " .
105 " profile_id = " .
$ilDB->quote($profile_id,
"integer")
118 "SELECT p.id, p.title, p.description, p.ref_id, p.skill_tree_id, p.image_id " .
119 " FROM skl_profile_user u JOIN skl_profile p ON (u.profile_id = p.id) " .
120 " WHERE u.user_id = " .
$ilDB->quote($user_id,
"integer") .
121 " ORDER BY p.title ASC" 123 while ($rec =
$ilDB->fetchAssoc($set)) {
127 return $user_profiles;
132 $rec[
"id"] = (
int) $rec[
"id"];
133 $rec[
"title"] = (string) $rec[
"title"];
134 $rec[
"description"] = (string) $rec[
"description"];
135 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
136 $rec[
"image_id"] = (string) $rec[
"image_id"];
137 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
139 return $this->factory_service->profile()->profile(
143 $rec[
"skill_tree_id"],
154 "SELECT count(*) ucnt FROM skl_profile_user " .
155 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
157 $rec =
$ilDB->fetchAssoc($set);
158 return (
int) $rec[
"ucnt"];
removeUserFromAllProfiles(int $user_id)
addUserToProfile(int $profile_id, int $user_id)
getProfilesOfUser(int $user_id)
__construct(\ilDBInterface $db=null, Service\SkillInternalFactoryService $factory_service=null)
Service SkillInternalFactoryService $factory_service
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)
getFromRecord(array $rec)
deleteProfileUsers(int $profile_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
countUsers(int $profile_id)
removeUserFromProfile(int $profile_id, int $user_id)