ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 Constructor. More...
 
 getSkillsForTableGUI ()
 
 getSkillsForPresentationGUI ()
 Get all skills for presentation gui. More...
 

Protected Member Functions

 getSingleSkills ()
 Get single skills of container. More...
 
 getProfileSkills ()
 Get profile skills of container. More...
 

Protected Attributes

 $tab_skills = array()
 
 $pres_skills = array()
 
 $container_skills
 
 $container_global_profiles
 
 $container_local_profiles
 
 $skmg_settings
 

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 10 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 
)

Constructor.

Parameters
ilContainerSkills$a_cont_skills
ilContainerGlobalProfiles$a_cont_glb_profiles
ilContainerLocalProfiles$a_cont_lcl_profiles

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

52 {
53 $this->container_skills = $a_cont_skills;
54 $this->container_global_profiles = $a_cont_glb_profiles;
55 $this->container_local_profiles = $a_cont_lcl_profiles;
56 $this->skmg_settings = new ilSkillManagementSettings();
57 }

Member Function Documentation

◆ getProfileSkills()

ilContSkillCollector::getProfileSkills ( )
protected

Get profile skills of container.

Returns
array

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

127 : array
128 {
129 $p_skills = array();
130 // Global skills
131 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
132 foreach ($this->container_global_profiles->getProfiles() as $gp) {
133 $profile = new ilSkillProfile($gp["profile_id"]);
134 $sklvs = $profile->getSkillLevels();
135 foreach ($sklvs as $s) {
136 $p_skills[] = array(
137 "base_skill_id" => $s["base_skill_id"],
138 "tref_id" => $s["tref_id"],
139 "title" => ilBasicSkill::_lookupTitle($s["base_skill_id"], $s["tref_id"]),
140 "profile" => $profile->getTitle()
141 );
142 }
143 }
144 }
145
146 // Local skills
147 if ($this->skmg_settings->getAllowLocalProfiles()) {
148 foreach ($this->container_local_profiles->getProfiles() as $lp) {
149 $profile = new ilSkillProfile($lp["profile_id"]);
150 $sklvs = $profile->getSkillLevels();
151 foreach ($sklvs as $s) {
152 $p_skills[] = array(
153 "base_skill_id" => $s["base_skill_id"],
154 "tref_id" => $s["tref_id"],
155 "title" => ilBasicSkill::_lookupTitle($s["base_skill_id"], $s["tref_id"]),
156 "profile" => $profile->getTitle()
157 );
158 }
159 }
160 }
161
162 return $p_skills;
163 }
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

References ilSkillTreeNode\_lookupTitle().

Referenced by getSkillsForPresentationGUI(), and getSkillsForTableGUI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleSkills()

ilContSkillCollector::getSingleSkills ( )
protected

Get single skills of container.

Returns
array

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

109 : array
110 {
111 $s_skills = array_map(function ($v) {
112 return array(
113 "base_skill_id" => $v["skill_id"],
114 "tref_id" => $v["tref_id"],
115 "title" => ilBasicSkill::_lookupTitle($v["skill_id"], $v["tref_id"])
116 );
117 }, $this->container_skills->getSkills());
118
119 return $s_skills;
120 }

References ilSkillTreeNode\_lookupTitle().

Referenced by getSkillsForPresentationGUI(), and getSkillsForTableGUI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSkillsForPresentationGUI()

ilContSkillCollector::getSkillsForPresentationGUI ( )

Get all skills for presentation gui.

Returns
array

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

83 : array
84 {
85 // Get single and profile skills WITH array keys so as to remove multiple occurrences when merging
86
87 $s_skills = $this->getSingleSkills();
88 $p_skills = array();
89
90 foreach ($this->getProfileSkills() as $ps) {
91 $p_skills[$ps["base_skill_id"] . "-" . $ps["tref_id"]] = array(
92 "base_skill_id" => $ps["base_skill_id"],
93 "tref_id" => $ps["tref_id"],
94 "title" => $ps["title"],
95 "profile" => $ps["profile"]
96 );
97 }
98
99 $this->pres_skills = array_merge($s_skills, $p_skills);
100
101 return $this->pres_skills;
102 }
getSingleSkills()
Get single skills of container.
getProfileSkills()
Get profile skills of container.

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

+ Here is the call graph for this function:

◆ getSkillsForTableGUI()

ilContSkillCollector::getSkillsForTableGUI ( )
Returns
array

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

62 : array
63 {
64 // Get single and profile skills WITHOUT array keys so as not to remove multiple occurrences when merging
65
66 $s_skills = array_values($this->getSingleSkills());
67 $p_skills = $this->getProfileSkills();
68
69 $this->tab_skills = array_merge($s_skills, $p_skills);
70
71 // order skills per virtual skill tree
72 $vtree = new ilVirtualSkillTree();
73 $this->tab_skills = $vtree->getOrderedNodeset($this->tab_skills, "base_skill_id", "tref_id");
74
75 return $this->tab_skills;
76 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $container_global_profiles

ilContSkillCollector::$container_global_profiles
protected

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

◆ $container_local_profiles

ilContSkillCollector::$container_local_profiles
protected

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

◆ $container_skills

ilContSkillCollector::$container_skills
protected

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

◆ $pres_skills

ilContSkillCollector::$pres_skills = array()
protected

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

Referenced by getSkillsForPresentationGUI().

◆ $skmg_settings

ilContSkillCollector::$skmg_settings
protected

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

◆ $tab_skills

ilContSkillCollector::$tab_skills = array()
protected

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

Referenced by getSkillsForTableGUI().


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