37 $this->db = $DIC->database();
39 $this->
setId($a_obj_id);
70 $this->skills = array();
79 public function addSkill($a_skill_id, $a_tref_id)
81 $this->skills[$a_skill_id .
"-" . $a_tref_id] = array(
82 "skill_id" => $a_skill_id,
83 "tref_id" => $a_tref_id
95 unset($this->skills[$a_skill_id .
"-" . $a_tref_id]);
118 return $vtree->getOrderedNodeset($this->
getSkills(),
"skill_id",
"tref_id");
129 $this->skills = array();
130 $set =
$db->query(
"SELECT * FROM cont_skills " .
131 " WHERE id = " .
$db->quote($this->getId(),
"integer"));
132 while ($rec =
$db->fetchAssoc($set)) {
133 $this->skills[$rec[
"skill_id"] .
"-" . $rec[
"tref_id"]] = $rec;
140 public function delete()
144 $db->manipulate(
"DELETE FROM cont_skills WHERE " .
145 " id = " .
$db->quote($this->getId(),
"integer"));
156 foreach ($this->skills as $s) {
157 $db->manipulate(
"INSERT INTO cont_skills " .
158 "(id, skill_id, tref_id) VALUES (" .
159 $db->quote($this->getId(),
"integer") .
"," .
160 $db->quote($s[
"skill_id"],
"integer") .
"," .
161 $db->quote($s[
"tref_id"],
"integer") .
")");
addSkill($a_skill_id, $a_tref_id)
Add skill.
resetSkills()
Reset skills.
__construct($a_obj_id)
Constrictor.
getOrderedSkills()
Get odered skills.
removeSkill($a_skill_id, $a_tref_id)
Remove skill.