19 declare(strict_types=1);
35 $this->db = $DIC->database();
42 $this->skill_template_id = $a_val;
50 public function read(): void
57 "SELECT * FROM skl_templ_ref " .
58 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
60 if ($rec =
$ilDB->fetchAssoc($set)) {
71 $ilDB->manipulate(
"INSERT INTO skl_templ_ref " .
72 "(skl_node_id, templ_id) VALUES (" .
73 $ilDB->quote($this->getId(),
"integer") .
"," .
74 $ilDB->quote($this->getSkillTemplateId(),
"integer") .
85 "UPDATE skl_templ_ref SET " .
86 " templ_id = " .
$ilDB->quote($this->getSkillTemplateId(),
"integer") .
87 " WHERE skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
91 public function delete():
void 96 "DELETE FROM skl_templ_ref WHERE " 97 .
" skl_node_id = " .
$ilDB->quote($this->getId(),
"integer")
108 $sktr->setType($this->
getType());
121 $ilDB = $DIC->database();
123 $query =
"SELECT templ_id FROM skl_templ_ref WHERE skl_node_id = " .
124 $ilDB->quote($a_obj_id,
"integer");
125 $obj_set =
$ilDB->query($query);
126 $obj_rec =
$ilDB->fetchAssoc($obj_set);
128 return (
int) $obj_rec[
"templ_id"];
139 $ilDB = $DIC->database();
142 "SELECT * FROM skl_templ_ref " .
143 " WHERE templ_id = " .
$ilDB->quote($a_template_id,
"integer")
146 while ($rec =
$ilDB->fetchAssoc($set)) {
147 $trefs[] = (
int) $rec[
"skl_node_id"];
161 $tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_tid);
162 $top_template_id = $tree->getTopParentNodeId($a_tid);
163 return self::_lookupTrefIdsForTopTemplateId($top_template_id);
static _lookupTemplateId(int $a_obj_id)
setSkillTemplateId(int $a_val)
Skill Template Reference.
static _lookupTrefIdsForTemplateId(int $a_tid)
static _lookupTrefIdsForTopTemplateId(int $a_template_id)
__construct(Container $dic, ilPlugin $plugin)
A node in the skill tree.