24 int $a_source_inst_id,
25 int $a_skill_import_id,
26 int $a_tref_import_id = 0
30 $template_ids = array();
31 if ($a_tref_import_id > 0) {
32 $skill_node_type =
"sktp";
35 $set =
$ilDB->query(
"SELECT * FROM skl_tree_node n JOIN skl_tree t ON (n.obj_id = t.child) " .
36 " WHERE n.import_id = " .
$ilDB->quote(
"il_" . ((
int) $a_source_inst_id) .
"_sktr_" . $a_tref_import_id,
38 " ORDER BY n.creation_date DESC ");
39 while ($rec =
$ilDB->fetchAssoc($set)) {
41 $template_ids[$t] = $rec[
"obj_id"];
45 $skill_node_type =
"skll";
47 $set =
$ilDB->query(
"SELECT * FROM skl_tree_node n JOIN skl_tree t ON (n.obj_id = t.child) " .
48 " WHERE n.import_id = " .
$ilDB->quote(
"il_" . ((
int) $a_source_inst_id) .
"_" . $skill_node_type .
"_" . $a_skill_import_id,
50 " ORDER BY n.creation_date DESC ");
52 while ($rec =
$ilDB->fetchAssoc($set)) {
53 $matching_trefs = array();
54 if ($a_tref_import_id > 0) {
58 foreach ($template_ids as $templ => $tref) {
59 if ($skill_template_id == $templ) {
60 $matching_trefs[] = $tref;
64 $matching_trefs = array(0);
67 foreach ($matching_trefs as $t) {
68 $results[] = array(
"skill_id" => $rec[
"obj_id"],
70 "creation_date" => $rec[
"creation_date"]
84 $set =
$ilDB->query(
"SELECT * FROM skl_level l JOIN skl_tree t ON (l.skill_id = t.child) " .
85 " WHERE l.import_id = " .
$ilDB->quote(
"il_" . ((
int) $a_source_inst_id) .
"_sklv_" . $a_level_import_id,
87 " ORDER BY l.creation_date DESC ");
89 while ($rec =
$ilDB->fetchAssoc($set)) {
90 $results[] = array(
"level_id" => $rec[
"id"],
"creation_date" => $rec[
"creation_date"]);
Interface ilBasicSkillTreeRepository.
getTopParentNodeId($a_node_id)
Get top parent node id for a node.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
__construct(ilDBInterface $db=null)
getCommonSkillIdForImportId(ilSkillTree $tree, int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)