ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSkillTreeNodeFactory Class Reference

Factory for skill tree nodes. More...

+ Collaboration diagram for ilSkillTreeNodeFactory:

Static Public Member Functions

static getInstance (int $a_id=0)
 

Detailed Description

Factory for skill tree nodes.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 26 of file class.ilSkillTreeNodeFactory.php.

Member Function Documentation

◆ getInstance()

static ilSkillTreeNodeFactory::getInstance ( int  $a_id = 0)
static

Definition at line 28 of file class.ilSkillTreeNodeFactory.php.

29 {
30 global $DIC;
31
32 $ilDB = $DIC->database();
33
34 $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
35 $ilDB->quote($a_id, "integer");
36 $obj_set = $ilDB->query($query);
37 $obj_rec = $ilDB->fetchAssoc($obj_set);
38 $obj_id = (int) $obj_rec["obj_id"];
39 $obj = null;
40
41 switch ($obj_rec["type"]) {
42 case "skll":
43 $obj = new ilBasicSkill();
44 $obj->setId($obj_id);
45 $obj->setDataRecord($obj_rec);
46 $obj->read();
47 break;
48
49 case "scat":
50 $obj = new ilSkillCategory();
51 $obj->setId($obj_id);
52 $obj->setDataRecord($obj_rec);
53 $obj->read();
54 break;
55
56 case "sktp":
57 $obj = new ilBasicSkillTemplate();
58 $obj->setId($obj_id);
59 $obj->setDataRecord($obj_rec);
60 $obj->read();
61 break;
62
63 case "sctp":
64 $obj = new ilSkillTemplateCategory();
65 $obj->setId($obj_id);
66 $obj->setDataRecord($obj_rec);
67 $obj->read();
68 break;
69
70 case "skrt":
71 $obj = new ilSkillRoot();
72 $obj->setId($obj_id);
73 $obj->setDataRecord($obj_rec);
74 $obj->read();
75 break;
76
77 case "sktr":
78 $obj = new ilSkillTemplateReference();
79 $obj->setId($obj_id);
80 $obj->setDataRecord($obj_rec);
81 $obj->read();
82 break;
83 }
84 return $obj;
85 }
Skill root node.
A node in the skill tree.
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ILIAS\Skill\Node\SkillDeletionManager\deleteNode(), ilObjSkillTreeGUI\deleteNodes(), ILIAS\Skill\Table\AssignMaterialsTable\getDataRetrieval(), ilPersonalSkillsGUI\getSelfEvaluationForm(), ilSkillTreeNodeGUI\readNodeObject(), ilObjSkillTreeGUI\saveAllTemplateTitles(), and ilObjSkillTreeGUI\saveAllTitles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: