19declare(strict_types=1);
27 protected \ilDBInterface
$db;
36 $this->db = (
$db) ?:
$DIC->database();
40 public function get(
int $profile_id): array
45 "SELECT * FROM skl_profile_user " .
46 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
49 while ($rec =
$ilDB->fetchAssoc($set)) {
58 return $this->factory_service->profile()->profileUserAssignment(
70 array(
"profile_id" => array(
"integer", $profile_id),
71 "user_id" => array(
"integer",
$user_id),
82 "DELETE FROM skl_profile_user WHERE " .
83 " profile_id = " .
$ilDB->quote($profile_id,
"integer") .
93 "DELETE FROM skl_profile_user WHERE " .
103 "DELETE FROM skl_profile_user WHERE " .
104 " profile_id = " .
$ilDB->quote($profile_id,
"integer")
117 "SELECT p.id, p.title, p.description, p.ref_id, p.skill_tree_id, p.image_id " .
118 " FROM skl_profile_user u JOIN skl_profile p ON (u.profile_id = p.id) " .
120 " ORDER BY p.title ASC"
122 while ($rec =
$ilDB->fetchAssoc($set)) {
126 return $user_profiles;
131 $rec[
"id"] = (
int) $rec[
"id"];
132 $rec[
"title"] = (string) $rec[
"title"];
133 $rec[
"description"] = (string) $rec[
"description"];
134 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
135 $rec[
"image_id"] = (string) $rec[
"image_id"];
136 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
138 return $this->factory_service->profile()->profile(
142 $rec[
"skill_tree_id"],
153 "SELECT count(*) ucnt FROM skl_profile_user " .
154 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
156 $rec =
$ilDB->fetchAssoc($set);
157 return (
int) $rec[
"ucnt"];
__construct(?\ilDBInterface $db=null, ?Service\SkillInternalFactoryService $factory_service=null)
removeUserFromProfile(int $profile_id, int $user_id)
removeUserFromAllProfiles(int $user_id)
deleteProfileUsers(int $profile_id)
getProfilesOfUser(int $user_id)
Service SkillInternalFactoryService $factory_service
getFromRecord(array $rec)
addUserToProfile(int $profile_id, int $user_id)
countUsers(int $profile_id)
getProfileFromRecord(array $rec)
Skill internal factory service.