29 protected int $id = 0;
47 string $image_id =
"",
59 $this->profile_levels_repo = $DIC->skills()->internal()->repo()->getProfileLevelsRepo();
61 if ($this->
getId() > 0) {
62 $levels = $this->profile_levels_repo->getProfileLevels($this->
getId());
63 foreach ($levels as $level) {
65 $level[
"base_skill_id"],
104 public function addSkillLevel(
int $base_skill_id,
int $tref_id,
int $level_id,
int $order_nr): void
106 $this->skill_level[] = array(
107 "base_skill_id" => $base_skill_id,
108 "tref_id" => $tref_id,
109 "level_id" => $level_id,
110 "order_nr" => $order_nr
114 public function removeSkillLevel(
int $base_skill_id,
int $tref_id,
int $level_id,
int $order_nr): void
116 foreach ($this->skill_level as $k => $sl) {
117 if ((
int) $sl[
"base_skill_id"] == $base_skill_id &&
118 (
int) $sl[
"tref_id"] == $tref_id &&
119 (
int) $sl[
"level_id"] == $level_id &&
120 (
int) $sl[
"order_nr"] == $order_nr) {
121 unset($this->skill_level[$k]);
131 usort($this->skill_level,
static function (array $level_a, array $level_b):
int {
132 return $level_a[
'order_nr'] <=> $level_b[
'order_nr'];
145 return \ilSkillUsage::getUsageInfoGeneric(
Get info on usages of skills.
__construct(int $id, string $title, string $description, int $skill_tree_id, string $image_id="", int $ref_id=0)
removeSkillLevel(int $base_skill_id, int $tref_id, int $level_id, int $order_nr)
static getUsageInfo(array $a_cskill_ids)
SkillProfileLevelsDBRepository $profile_levels_repo
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addSkillLevel(int $base_skill_id, int $tref_id, int $level_id, int $order_nr)