ILIAS  trunk Revision v11.0_alpha-1838-g59fc79e306b
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.SkillProfileService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Skill\Service;
22 
24 
30 {
33 
34  public function __construct(SkillInternalService $internal_service)
35  {
36  $this->profile_manager = $internal_service->manager()->getProfileManager();
37  $this->profile_completion_manager = $internal_service->manager()->getProfileCompletionManager();
38  }
39 
43  public function getProfile(int $profile_id): Profile\SkillProfile
44  {
45  return $this->profile_manager->getProfile($profile_id);
46  }
47 
48  public function deleteProfile(int $profile_id): void
49  {
50  $this->profile_manager->delete($profile_id);
51  $this->profile_completion_manager->deleteEntriesForProfile($profile_id);
52  }
53 
54  public function lookupProfileTitle(int $profile_id): string
55  {
56  $title = $this->profile_manager->lookupTitle($profile_id);
57  return $title;
58  }
59 
60  public function lookupProfileRefId(int $profile_id): int
61  {
62  $ref_id = $this->profile_manager->lookupRefId($profile_id);
63  return $ref_id;
64  }
65 
69  public function getSkillLevels(int $profile_id): array
70  {
71  return $this->profile_manager->getSkillLevels($profile_id);
72  }
73 
77  public function getProfilesOfUser(int $user_id): array
78  {
79  return $this->profile_manager->getProfilesOfUser($user_id);
80  }
81 
85  public function getAllGlobalProfiles(): array
86  {
87  $profiles = $this->profile_manager->getAllGlobalProfiles();
88  return $profiles;
89  }
90 
95  public function getAllProfilesOfRole(int $role_id): array
96  {
97  $profiles = $this->profile_manager->getAllProfilesOfRole($role_id);
98  return $profiles;
99  }
100 
104  public function getGlobalProfilesOfRole(int $role_id): array
105  {
106  $profiles = $this->profile_manager->getGlobalProfilesOfRole($role_id);
107  return $profiles;
108  }
109 
113  public function getLocalProfilesOfRole(int $role_id): array
114  {
115  $profiles = $this->profile_manager->getLocalProfilesOfRole($role_id);
116  return $profiles;
117  }
118 
119  public function addRoleToProfile(int $profile_id, int $role_id): void
120  {
121  $this->profile_manager->addRoleToProfile($profile_id, $role_id);
122  }
123 
124  public function removeRoleFromProfile(int $profile_id, int $role_id): void
125  {
126  $this->profile_manager->removeRoleFromProfile($profile_id, $role_id);
127  }
128 
132  public function updateProfileRefIdAfterImport(int $profile_id, int $new_ref_id): void
133  {
134  $this->profile_manager->updateRefIdAfterImport($profile_id, $new_ref_id);
135  }
136 
140  public function writeCompletionEntryForAllProfiles(int $user_id): void
141  {
142  $this->profile_completion_manager->writeCompletionEntryForAllProfilesOfUser($user_id);
143  }
144 }
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:65
removeRoleFromProfile(int $profile_id, int $role_id)
Profile SkillProfileCompletionManager $profile_completion_manager
writeCompletionEntryForAllProfiles(int $user_id)
Write profile completion entries (fulfilled or non-fulfilled) of user for all profiles.
__construct(SkillInternalService $internal_service)