40 int $a_source_inst_id,
41 int $a_skill_import_id,
42 int $a_tref_import_id = 0
47 if ($a_tref_import_id > 0) {
48 $skill_node_type =
"sktp";
51 $set =
$ilDB->query(
"SELECT * FROM skl_tree_node n JOIN skl_tree t ON (n.obj_id = t.child) " .
52 " WHERE n.import_id = " .
$ilDB->quote(
53 "il_" . ($a_source_inst_id) .
"_sktr_" . $a_tref_import_id,
56 " ORDER BY n.creation_date DESC ");
57 while ($rec =
$ilDB->fetchAssoc($set)) {
59 $template_ids[$t] = (
int) $rec[
"obj_id"];
63 $skill_node_type =
"skll";
65 $set =
$ilDB->query(
"SELECT * FROM skl_tree_node n JOIN skl_tree t ON (n.obj_id = t.child) " .
66 " WHERE n.import_id = " .
$ilDB->quote(
67 "il_" . ($a_source_inst_id) .
"_" . $skill_node_type .
"_" . $a_skill_import_id,
70 " ORDER BY n.creation_date DESC ");
72 while ($rec =
$ilDB->fetchAssoc($set)) {
74 if ($a_tref_import_id > 0) {
75 $tree = $this->tree_factory->getTreeById($rec[
"skl_tree_id"]);
76 $skill_template_id = $tree->getTopParentNodeId($rec[
"obj_id"]);
79 foreach ($template_ids as $templ => $tref) {
80 if ($skill_template_id == $templ) {
81 $matching_trefs[] = $tref;
85 $matching_trefs = array(0);
88 foreach ($matching_trefs as $t) {
89 $results[] = array(
"skill_id" => (
int) $rec[
"obj_id"],
91 "creation_date" => $rec[
"creation_date"]
105 $set =
$ilDB->query(
"SELECT * FROM skl_level l JOIN skl_tree t ON (l.skill_id = t.child) " .
106 " WHERE l.import_id = " .
$ilDB->quote(
107 "il_" . ($a_source_inst_id) .
"_sklv_" . $a_level_import_id,
110 " ORDER BY l.creation_date DESC ");
112 while ($rec =
$ilDB->fetchAssoc($set)) {
113 $results[] = array(
"level_id" => (
int) $rec[
"id"],
"creation_date" => $rec[
"creation_date"]);
132 "SELECT * FROM skl_tree " .
133 " WHERE child = %s ",
138 return (
int) ($rec[
"skl_tree_id"] ?? 0);
144 return $this->tree_factory->getTreeById($tree_id);
150 return $this->tree_factory->getVirtualTreeById($tree_id);
158 "SELECT * FROM skl_tree " .
159 " WHERE child = %s ",
164 return (
int) ($rec[
"parent"] ?? 0);
Tree SkillTreeFactory $tree_factory
static _lookupTemplateId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fetchAssoc(ilDBStatement $statement)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)
getTreeForNodeId(int $node_id)
__construct(Tree\SkillTreeFactory $tree_factory, ilDBInterface $db=null)
getParentNodeIdForNodeId(int $node_id)
queryF(string $query, array $types, array $values)
getVirtualTreeForNodeId(int $node_id)
getTreeIdForNodeId(int $node_id)
getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
isInAnyTree(int $node_id)