ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContSkillCollector Class Reference

Collector of skills for a container. More...

+ Collaboration diagram for ilContSkillCollector:

Public Member Functions

 __construct (ilContainerSkills $a_cont_skills, ilContainerGlobalProfiles $a_cont_glb_profiles, ilContainerLocalProfiles $a_cont_lcl_profiles)
 
 getSkillsForTableGUI ()
 
 getSkillsForPresentationGUI ()
 

Protected Member Functions

 getSingleSkills ()
 
 getProfileSkills ()
 

Protected Attributes

array $tab_skills = []
 
array $pres_skills = []
 
ilContainerSkills $container_skills
 
ilContainerGlobalProfiles $container_global_profiles
 
ilContainerLocalProfiles $container_local_profiles
 
ilSkillManagementSettings $skmg_settings
 
SkillTreeService $tree_service
 
SkillProfileService $profile_service
 

Detailed Description

Collector of skills for a container.

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 28 of file class.ilContSkillCollector.php.

Constructor & Destructor Documentation

◆ __construct()

ilContSkillCollector::__construct ( ilContainerSkills  $a_cont_skills,
ilContainerGlobalProfiles  $a_cont_glb_profiles,
ilContainerLocalProfiles  $a_cont_lcl_profiles 
)

Definition at line 39 of file class.ilContSkillCollector.php.

References $DIC.

43  {
44  global $DIC;
45 
46  $this->container_skills = $a_cont_skills;
47  $this->container_global_profiles = $a_cont_glb_profiles;
48  $this->container_local_profiles = $a_cont_lcl_profiles;
49  $this->skmg_settings = new ilSkillManagementSettings();
50  $this->tree_service = $DIC->skills()->tree();
51  $this->profile_service = $DIC->skills()->profile();
52  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ getProfileSkills()

ilContSkillCollector::getProfileSkills ( )
protected

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

References ilSkillTreeNode\_lookupTitle().

Referenced by getSkillsForPresentationGUI(), and getSkillsForTableGUI().

104  : array
105  {
106  $p_skills = [];
107  // Global skills
108  if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
109  foreach ($this->container_global_profiles->getProfiles() as $gp) {
110  $profile = $this->profile_service->getById($gp["profile_id"]);
111  $sklvs = $profile->getSkillLevels();
112  foreach ($sklvs as $s) {
113  $p_skills[] = [
114  "base_skill_id" => $s["base_skill_id"],
115  "tref_id" => $s["tref_id"],
116  "title" => ilBasicSkill::_lookupTitle($s["base_skill_id"], $s["tref_id"]),
117  "profile" => $profile->getTitle()
118  ];
119  }
120  }
121  }
122 
123  // Local skills
124  if ($this->skmg_settings->getAllowLocalProfiles()) {
125  foreach ($this->container_local_profiles->getProfiles() as $lp) {
126  $profile = $this->profile_service->getById($lp["profile_id"]);
127  $sklvs = $profile->getSkillLevels();
128  foreach ($sklvs as $s) {
129  $p_skills[] = [
130  "base_skill_id" => $s["base_skill_id"],
131  "tref_id" => $s["tref_id"],
132  "title" => ilBasicSkill::_lookupTitle($s["base_skill_id"], $s["tref_id"]),
133  "profile" => $profile->getTitle()
134  ];
135  }
136  }
137  }
138 
139  return $p_skills;
140  }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleSkills()

ilContSkillCollector::getSingleSkills ( )
protected

Definition at line 91 of file class.ilContSkillCollector.php.

References ilSkillTreeNode\_lookupTitle().

Referenced by getSkillsForPresentationGUI(), and getSkillsForTableGUI().

91  : array
92  {
93  $s_skills = array_map(static function (array $v): array {
94  return [
95  "base_skill_id" => $v["skill_id"],
96  "tref_id" => $v["tref_id"],
97  "title" => ilBasicSkill::_lookupTitle($v["skill_id"], $v["tref_id"])
98  ];
99  }, $this->container_skills->getSkills());
100 
101  return $s_skills;
102  }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSkillsForPresentationGUI()

ilContSkillCollector::getSkillsForPresentationGUI ( )

Definition at line 70 of file class.ilContSkillCollector.php.

References $pres_skills, getProfileSkills(), and getSingleSkills().

70  : array
71  {
72  // Get single and profile skills WITH array keys so as to remove multiple occurrences when merging
73 
74  $s_skills = $this->getSingleSkills();
75  $p_skills = [];
76 
77  foreach ($this->getProfileSkills() as $ps) {
78  $p_skills[$ps["base_skill_id"] . "-" . $ps["tref_id"]] = [
79  "base_skill_id" => $ps["base_skill_id"],
80  "tref_id" => $ps["tref_id"],
81  "title" => $ps["title"],
82  "profile" => $ps["profile"]
83  ];
84  }
85 
86  $this->pres_skills = array_merge($s_skills, $p_skills);
87 
88  return $this->pres_skills;
89  }
+ Here is the call graph for this function:

◆ getSkillsForTableGUI()

ilContSkillCollector::getSkillsForTableGUI ( )

Definition at line 54 of file class.ilContSkillCollector.php.

References $tab_skills, getProfileSkills(), and getSingleSkills().

54  : array
55  {
56  // Get single and profile skills WITHOUT array keys so as not to remove multiple occurrences when merging
57 
58  $s_skills = array_values($this->getSingleSkills());
59  $p_skills = $this->getProfileSkills();
60 
61  $this->tab_skills = array_merge($s_skills, $p_skills);
62 
63  // order skills per virtual skill tree
64  $vtree = $this->tree_service->getGlobalVirtualSkillTree();
65  $this->tab_skills = $vtree->getOrderedNodeset($this->tab_skills, "base_skill_id", "tref_id");
66 
67  return $this->tab_skills;
68  }
+ Here is the call graph for this function:

Field Documentation

◆ $container_global_profiles

ilContainerGlobalProfiles ilContSkillCollector::$container_global_profiles
protected

Definition at line 33 of file class.ilContSkillCollector.php.

◆ $container_local_profiles

ilContainerLocalProfiles ilContSkillCollector::$container_local_profiles
protected

Definition at line 34 of file class.ilContSkillCollector.php.

◆ $container_skills

ilContainerSkills ilContSkillCollector::$container_skills
protected

Definition at line 32 of file class.ilContSkillCollector.php.

◆ $pres_skills

array ilContSkillCollector::$pres_skills = []
protected

Definition at line 31 of file class.ilContSkillCollector.php.

Referenced by getSkillsForPresentationGUI().

◆ $profile_service

SkillProfileService ilContSkillCollector::$profile_service
protected

Definition at line 37 of file class.ilContSkillCollector.php.

◆ $skmg_settings

ilSkillManagementSettings ilContSkillCollector::$skmg_settings
protected

Definition at line 35 of file class.ilContSkillCollector.php.

◆ $tab_skills

array ilContSkillCollector::$tab_skills = []
protected

Definition at line 30 of file class.ilContSkillCollector.php.

Referenced by getSkillsForTableGUI().

◆ $tree_service

SkillTreeService ilContSkillCollector::$tree_service
protected

Definition at line 36 of file class.ilContSkillCollector.php.


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