3 declare(strict_types=1);
36 $this->db = $DIC->database();
43 $this->skill_template_id = $a_val;
51 public function read(): void
58 "SELECT * FROM skl_templ_ref " .
59 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
61 if ($rec =
$ilDB->fetchAssoc($set)) {
72 $ilDB->manipulate(
"INSERT INTO skl_templ_ref " .
73 "(skl_node_id, templ_id) VALUES (" .
74 $ilDB->quote($this->getId(),
"integer") .
"," .
75 $ilDB->quote($this->getSkillTemplateId(),
"integer") .
86 "UPDATE skl_templ_ref SET " .
87 " templ_id = " .
$ilDB->quote($this->getSkillTemplateId(),
"integer") .
88 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
92 public function delete():
void 97 "DELETE FROM skl_templ_ref WHERE " 98 .
" skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
109 $sktr->setType($this->
getType());
122 $ilDB = $DIC->database();
124 $query =
"SELECT templ_id FROM skl_templ_ref WHERE skl_node_id = " .
125 $ilDB->quote($a_obj_id,
"integer");
126 $obj_set =
$ilDB->query($query);
127 $obj_rec =
$ilDB->fetchAssoc($obj_set);
129 return (
int) $obj_rec[
"templ_id"];
140 $ilDB = $DIC->database();
143 "SELECT * FROM skl_templ_ref " .
144 " WHERE templ_id = " .
$ilDB->quote($a_template_id,
"integer")
147 while ($rec =
$ilDB->fetchAssoc($set)) {
148 $trefs[] = (
int) $rec[
"skl_node_id"];
162 $tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_tid);
163 $top_template_id = $tree->getTopParentNodeId($a_tid);
164 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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...