52 $this->db = $DIC->database();
56 if ($a_obj_id > 0 && $a_user_id > 0) {
68 $this->obj_id = $a_val;
88 $this->user_id = $a_val;
109 "SELECT * FROM cont_member_skills " .
110 " WHERE obj_id = " .
$db->quote($this->getObjId(),
"integer") .
111 " AND user_id = " .
$db->quote($this->getUserId(),
"integer")
113 $this->skill_levels = array();
114 while ($rec = $this->db->fetchAssoc($set)) {
115 $this->skill_levels[$rec[
"skill_id"] .
":" . $rec[
"tref_id"]] = $rec[
"level_id"];
116 $this->published = $rec[
"published"];
138 $s = explode(
":", $k);
139 return array(
"level_id" => $a,
"skill_id" =>
$s[0],
"tref_id" =>
$s[1]);
142 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
144 return $vtree->getOrderedNodeset(
$skill_levels,
"skill_id",
"tref_id");
168 foreach ($a_level_data as $k => $v) {
169 $sk = explode(
":", $k);
170 $db->manipulate(
"INSERT INTO cont_member_skills " .
171 "(obj_id, user_id, skill_id, tref_id, level_id, published) VALUES (" .
172 $db->quote($this->getObjId(),
"integer") .
"," .
173 $db->quote($this->getUserId(),
"integer") .
"," .
174 $db->quote($sk[0],
"integer") .
"," .
175 $db->quote($sk[1],
"integer") .
"," .
176 $db->quote($v,
"integer") .
"," .
177 $db->quote(0,
"integer") .
181 $this->skill_levels = $a_level_data;
189 public function delete()
193 $db->manipulate(
"DELETE FROM cont_member_skills WHERE " .
194 " obj_id = " .
$db->quote($this->getObjId(),
"integer") .
195 " AND user_id = " .
$db->quote($this->getUserId(),
"integer"));
212 foreach ($this->skill_levels as $sk =>
$l) {
214 $sk = explode(
":", $sk);
227 $db->manipulate(
"UPDATE cont_member_skills SET " .
228 " published = " .
$db->quote(1,
"integer") .
229 " WHERE obj_id = " .
$db->quote($this->
getObjId(),
"integer") .
230 " AND user_id = " .
$db->quote($this->
getUserId(),
"integer"));
__construct($a_obj_id, $a_user_id)
Constrictor.
getPublished()
Get published.
getSkillLevels()
Get Skill levels.
saveLevelForSkills($a_level_data)
Save levels for skills.
setUserId($a_val)
Set user id.
publish($a_ref_id)
Publish.
setObjId($a_val)
Set object id.
static removeAllUserSkillLevelStatusOfObject($a_user_id, $a_trigger_obj_id, $a_self_eval=false, $a_unique_identifier="")
Remove a user skill completely.
static writeUserSkillLevelStatus( $a_level_id, $a_user_id, $a_trigger_ref_id, $a_tref_id=0, $a_status=ilBasicSkill::ACHIEVED, $a_force=false, $a_self_eval=false, $a_unique_identifier="")
Write skill level status.
removeAllSkillLevels()
Remove all skill levels.
getOrderedSkillLevels()
Get ordered skill levels.