ILIAS  release_8 Revision v8.24
class.ilSkillTreeNodeFactory.php
Go to the documentation of this file.
1<?php
2
26{
27 public static function getInstance(int $a_id = 0): ilSkillTreeNode
28 {
29 global $DIC;
30
31 $ilDB = $DIC->database();
32
33 $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
34 $ilDB->quote($a_id, "integer");
35 $obj_set = $ilDB->query($query);
36 $obj_rec = $ilDB->fetchAssoc($obj_set);
37 $obj = null;
38
39 switch ($obj_rec["type"]) {
40 case "skll":
41 $obj = new ilBasicSkill();
42 $obj->setId($obj_rec["obj_id"]);
43 $obj->setDataRecord($obj_rec);
44 $obj->read();
45 break;
46
47 case "scat":
48 $obj = new ilSkillCategory();
49 $obj->setId($obj_rec["obj_id"]);
50 $obj->setDataRecord($obj_rec);
51 $obj->read();
52 break;
53
54 case "sktp":
55 $obj = new ilBasicSkillTemplate();
56 $obj->setId($obj_rec["obj_id"]);
57 $obj->setDataRecord($obj_rec);
58 $obj->read();
59 break;
60
61 case "sctp":
62 $obj = new ilSkillTemplateCategory();
63 $obj->setId($obj_rec["obj_id"]);
64 $obj->setDataRecord($obj_rec);
65 $obj->read();
66 break;
67
68 case "skrt":
69 $obj = new ilSkillRoot();
70 $obj->setId($obj_rec["obj_id"]);
71 $obj->setDataRecord($obj_rec);
72 $obj->read();
73 break;
74
75 case "sktr":
76 $obj = new ilSkillTemplateReference();
77 $obj->setId($obj_rec["obj_id"]);
78 $obj->setDataRecord($obj_rec);
79 $obj->read();
80 break;
81 }
82 return $obj;
83 }
84}
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...
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...
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...
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...
global $DIC
Definition: feed.php:28
$query