ILIAS  release_8 Revision v8.23
ILIAS\Skill\Profile\SkillProfile Class Reference

Skill profile. More...

+ Inheritance diagram for ILIAS\Skill\Profile\SkillProfile:
+ Collaboration diagram for ILIAS\Skill\Profile\SkillProfile:

Public Member Functions

 __construct (int $id, string $title, string $description, int $skill_tree_id, string $image_id="", int $ref_id=0)
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getRefId ()
 
 getImageId ()
 
 getSkillTreeId ()
 
 addSkillLevel (int $base_skill_id, int $tref_id, int $level_id, int $order_nr)
 
 removeSkillLevel (int $base_skill_id, int $tref_id, int $level_id, int $order_nr)
 
 getSkillLevels ()
 

Static Public Member Functions

static getUsageInfo (array $a_cskill_ids)
 

Protected Attributes

int $id = 0
 
string $title = ""
 
string $description = ""
 
int $skill_tree_id = 0
 
string $image_id = ""
 
int $ref_id = 0
 
array $skill_level = []
 
SkillProfileLevelsDBRepository $profile_levels_repo
 

Detailed Description

Skill profile.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 27 of file class.SkillProfile.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Skill\Profile\SkillProfile::__construct ( int  $id,
string  $title,
string  $description,
int  $skill_tree_id,
string  $image_id = "",
int  $ref_id = 0 
)

Definition at line 42 of file class.SkillProfile.php.

References ILIAS\Skill\Profile\SkillProfile\$description, $DIC, ILIAS\Skill\Profile\SkillProfile\$id, ILIAS\Skill\Profile\SkillProfile\$image_id, ILIAS\Skill\Profile\SkillProfile\$ref_id, ILIAS\Skill\Profile\SkillProfile\$skill_tree_id, ILIAS\Skill\Profile\SkillProfile\$title, ILIAS\Skill\Profile\SkillProfile\addSkillLevel(), and ILIAS\Skill\Profile\SkillProfile\getId().

49  {
50  global $DIC;
51 
52  $this->id = $id;
53  $this->title = $title;
54  $this->description = $description;
55  $this->skill_tree_id = $skill_tree_id;
56  $this->image_id = $image_id;
57  $this->ref_id = $ref_id;
58 
59  $this->profile_levels_repo = $DIC->skills()->internal()->repo()->getProfileLevelsRepo();
60 
61  if ($this->getId() > 0) {
62  $levels = $this->profile_levels_repo->getProfileLevels($this->getId());
63  foreach ($levels as $level) {
64  $this->addSkillLevel(
65  $level["base_skill_id"],
66  $level["tref_id"],
67  $level["level_id"],
68  $level["order_nr"]
69  );
70  }
71  }
72  }
global $DIC
Definition: feed.php:28
addSkillLevel(int $base_skill_id, int $tref_id, int $level_id, int $order_nr)
+ Here is the call graph for this function:

Member Function Documentation

◆ addSkillLevel()

ILIAS\Skill\Profile\SkillProfile::addSkillLevel ( int  $base_skill_id,
int  $tref_id,
int  $level_id,
int  $order_nr 
)

Definition at line 104 of file class.SkillProfile.php.

Referenced by ILIAS\Skill\Profile\SkillProfile\__construct().

104  : void
105  {
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
111  );
112  }
+ Here is the caller graph for this function:

◆ getDescription()

ILIAS\Skill\Profile\SkillProfile::getDescription ( )

◆ getId()

ILIAS\Skill\Profile\SkillProfile::getId ( )

◆ getImageId()

ILIAS\Skill\Profile\SkillProfile::getImageId ( )

Definition at line 94 of file class.SkillProfile.php.

References ILIAS\Skill\Profile\SkillProfile\$image_id.

Referenced by ILIAS\Skill\Profile\SkillProfileDBRepository\createProfile(), and ILIAS\Skill\Profile\SkillProfileDBRepository\updateProfile().

94  : string
95  {
96  return $this->image_id;
97  }
+ Here is the caller graph for this function:

◆ getRefId()

ILIAS\Skill\Profile\SkillProfile::getRefId ( )

◆ getSkillLevels()

ILIAS\Skill\Profile\SkillProfile::getSkillLevels ( )
Returns
array{base_skill_id: int, tref_id: int, level_id: int, order_nr: int}[]

Definition at line 129 of file class.SkillProfile.php.

References ILIAS\Skill\Profile\SkillProfile\$skill_level.

Referenced by ILIAS\Skill\Profile\SkillProfileManager\updateProfile().

129  : array
130  {
131  usort($this->skill_level, static function (array $level_a, array $level_b): int {
132  return $level_a['order_nr'] <=> $level_b['order_nr'];
133  });
134 
135  return $this->skill_level;
136  }
+ Here is the caller graph for this function:

◆ getSkillTreeId()

ILIAS\Skill\Profile\SkillProfile::getSkillTreeId ( )

Definition at line 99 of file class.SkillProfile.php.

References ILIAS\Skill\Profile\SkillProfile\$skill_tree_id.

Referenced by ILIAS\Skill\Profile\SkillProfileDBRepository\createProfile().

99  : int
100  {
101  return $this->skill_tree_id;
102  }
+ Here is the caller graph for this function:

◆ getTitle()

ILIAS\Skill\Profile\SkillProfile::getTitle ( )

Definition at line 79 of file class.SkillProfile.php.

References ILIAS\Skill\Profile\SkillProfile\$title.

Referenced by ILIAS\Skill\Profile\SkillProfileDBRepository\createProfile(), and ILIAS\Skill\Profile\SkillProfileDBRepository\updateProfile().

79  : string
80  {
81  return $this->title;
82  }
+ Here is the caller graph for this function:

◆ getUsageInfo()

static ILIAS\Skill\Profile\SkillProfile::getUsageInfo ( array  $a_cskill_ids)
static
Parameters
array{skill_idint, tref_id: int}[] $a_cskill_ids
Returns
array<string, array<string, array{key: string}[]>>

Implements ilSkillUsageInfo.

Definition at line 143 of file class.SkillProfile.php.

References ilSkillUsage\PROFILE.

143  : array
144  {
145  return \ilSkillUsage::getUsageInfoGeneric(
146  $a_cskill_ids,
148  "skl_profile_level",
149  "profile_id",
150  "base_skill_id"
151  );
152  }

◆ removeSkillLevel()

ILIAS\Skill\Profile\SkillProfile::removeSkillLevel ( int  $base_skill_id,
int  $tref_id,
int  $level_id,
int  $order_nr 
)

Definition at line 114 of file class.SkillProfile.php.

114  : void
115  {
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]);
122  }
123  }
124  }

Field Documentation

◆ $description

string ILIAS\Skill\Profile\SkillProfile::$description = ""
protected

◆ $id

int ILIAS\Skill\Profile\SkillProfile::$id = 0
protected

◆ $image_id

string ILIAS\Skill\Profile\SkillProfile::$image_id = ""
protected

◆ $profile_levels_repo

SkillProfileLevelsDBRepository ILIAS\Skill\Profile\SkillProfile::$profile_levels_repo
protected

Definition at line 40 of file class.SkillProfile.php.

◆ $ref_id

int ILIAS\Skill\Profile\SkillProfile::$ref_id = 0
protected

◆ $skill_level

array ILIAS\Skill\Profile\SkillProfile::$skill_level = []
protected

◆ $skill_tree_id

int ILIAS\Skill\Profile\SkillProfile::$skill_tree_id = 0
protected

◆ $title

string ILIAS\Skill\Profile\SkillProfile::$title = ""
protected

The documentation for this class was generated from the following file: