ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.SkillProfileService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 namespace ILIAS\Skill\Service;
23 
25 
31 {
34 
35  public function __construct(SkillInternalService $internal_service)
36  {
37  $this->profile_manager = $internal_service->manager()->getProfileManager();
38  $this->profile_completion_manager = $internal_service->manager()->getProfileCompletionManager();
39  }
40 
44  public function getProfile(int $profile_id): Profile\SkillProfile
45  {
46  return $this->profile_manager->getProfile($profile_id);
47  }
48 
49  public function deleteProfile(int $profile_id): void
50  {
51  $this->profile_manager->delete($profile_id);
52  $this->profile_completion_manager->deleteEntriesForProfile($profile_id);
53  }
54 
55  public function lookupProfileTitle(int $profile_id): string
56  {
57  $title = $this->profile_manager->lookupTitle($profile_id);
58  return $title;
59  }
60 
61  public function lookupProfileRefId(int $profile_id): int
62  {
63  $ref_id = $this->profile_manager->lookupRefId($profile_id);
64  return $ref_id;
65  }
66 
70  public function getSkillLevels(int $profile_id): array
71  {
72  return $this->profile_manager->getSkillLevels($profile_id);
73  }
74 
78  public function getProfilesOfUser(int $user_id): array
79  {
80  return $this->profile_manager->getProfilesOfUser($user_id);
81  }
82 
86  public function getAllGlobalProfiles(): array
87  {
88  $profiles = $this->profile_manager->getAllGlobalProfiles();
89  return $profiles;
90  }
91 
96  public function getAllProfilesOfRole(int $role_id): array
97  {
98  $profiles = $this->profile_manager->getAllProfilesOfRole($role_id);
99  return $profiles;
100  }
101 
105  public function getGlobalProfilesOfRole(int $role_id): array
106  {
107  $profiles = $this->profile_manager->getGlobalProfilesOfRole($role_id);
108  return $profiles;
109  }
110 
114  public function getLocalProfilesOfRole(int $role_id): array
115  {
116  $profiles = $this->profile_manager->getLocalProfilesOfRole($role_id);
117  return $profiles;
118  }
119 
120  public function addRoleToProfile(int $profile_id, int $role_id): void
121  {
122  $this->profile_manager->addRoleToProfile($profile_id, $role_id);
123  }
124 
125  public function removeRoleFromProfile(int $profile_id, int $role_id): void
126  {
127  $this->profile_manager->removeRoleFromProfile($profile_id, $role_id);
128  }
129 
133  public function updateProfileRefIdAfterImport(int $profile_id, int $new_ref_id): void
134  {
135  $this->profile_manager->updateRefIdAfterImport($profile_id, $new_ref_id);
136  }
137 
141  public function writeCompletionEntryForAllProfiles(int $user_id): void
142  {
143  $this->profile_completion_manager->writeCompletionEntryForAllProfilesOfUser($user_id);
144  }
145 }
updateProfileRefIdAfterImport(int $profile_id, int $new_ref_id)
Update the old ref id with the new ref id after import.
getAllProfilesOfRole(int $role_id)
Get global and local profiles of a role.
$ref_id
Definition: ltiauth.php:66
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...
Profile SkillProfileCompletionManager $profile_completion_manager
writeCompletionEntryForAllProfiles(int $user_id)
Write profile completion entries (fulfilled or non-fulfilled) of user for all profiles.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(SkillInternalService $internal_service)