34 $this->db = $DIC->database();
41 $this->skill_template_id = $a_val;
49 public function read(): void
56 "SELECT * FROM skl_templ_ref " .
57 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
59 if ($rec =
$ilDB->fetchAssoc($set)) {
70 $ilDB->manipulate(
"INSERT INTO skl_templ_ref " .
71 "(skl_node_id, templ_id) VALUES (" .
72 $ilDB->quote($this->getId(),
"integer") .
"," .
73 $ilDB->quote($this->getSkillTemplateId(),
"integer") .
84 "UPDATE skl_templ_ref SET " .
85 " templ_id = " .
$ilDB->quote($this->getSkillTemplateId(),
"integer") .
86 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
90 public function delete():
void 95 "DELETE FROM skl_templ_ref WHERE " 96 .
" skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
107 $sktr->setType($this->
getType());
120 $ilDB = $DIC->database();
122 $query =
"SELECT templ_id FROM skl_templ_ref WHERE skl_node_id = " .
123 $ilDB->quote($a_obj_id,
"integer");
125 $obj_rec =
$ilDB->fetchAssoc($obj_set);
127 return (
int) $obj_rec[
"templ_id"];
138 $ilDB = $DIC->database();
141 "SELECT * FROM skl_templ_ref " .
142 " WHERE templ_id = " .
$ilDB->quote($a_template_id,
"integer")
145 while ($rec =
$ilDB->fetchAssoc($set)) {
146 $trefs[] = (
int) $rec[
"skl_node_id"];
160 $tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_tid);
161 $top_template_id = $tree->getTopParentNodeId($a_tid);
162 return self::_lookupTrefIdsForTopTemplateId($top_template_id);
static _lookupTemplateId(int $a_obj_id)
setSkillTemplateId(int $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTrefIdsForTemplateId(int $a_tid)
static _lookupTrefIdsForTopTemplateId(int $a_template_id)
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...