ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilSCORM2004NodeFactory Class Reference

Class ilSCORM2004NodeFactory. More...

+ Collaboration diagram for ilSCORM2004NodeFactory:

Static Public Member Functions

static getInstance ($a_slm_object, $a_id=0, $a_halt=true)
 

Detailed Description

Class ilSCORM2004NodeFactory.

Factory for SCORM Editor Tree nodes (Chapters/SCOs/Pages)

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

Definition at line 21 of file class.ilSCORM2004NodeFactory.php.

Member Function Documentation

◆ getInstance()

static ilSCORM2004NodeFactory::getInstance (   $a_slm_object,
  $a_id = 0,
  $a_halt = true 
)
static

Definition at line 23 of file class.ilSCORM2004NodeFactory.php.

24 {
25 global $DIC;
26
27 $ilDB = $DIC->database();
28
29 $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = " .
30 $ilDB->quote($a_id, "integer");
31 $obj_set = $ilDB->query($query);
32 $obj_rec = $ilDB->fetchAssoc($obj_set);
33 $obj = null;
34 switch ($obj_rec["type"]) {
35 case "chap":
36 $obj = new ilSCORM2004Chapter($a_slm_object);
37 $obj->setId($obj_rec["obj_id"]);
38 $obj->setDataRecord($obj_rec);
39 $obj->read();
40 break;
41
42 case "seqc":
43 $obj = new ilSCORM2004SeqChapter($a_slm_object);
44 $obj->setId($obj_rec["obj_id"]);
45 $obj->setDataRecord($obj_rec);
46 $obj->read();
47 break;
48
49 case "sco":
50 $obj = new ilSCORM2004Sco($a_slm_object);
51 $obj->setId($obj_rec["obj_id"]);
52 $obj->setDataRecord($obj_rec);
53 $obj->read();
54 break;
55
56 case "ass":
57 $obj = new ilSCORM2004Asset($a_slm_object);
58 $obj->setId($obj_rec["obj_id"]);
59 $obj->setDataRecord($obj_rec);
60 $obj->read();
61 break;
62
63 case "page":
64 $obj = new ilSCORM2004PageNode($a_slm_object, 0, $a_halt);
65 $obj->setId($obj_rec["obj_id"]);
66 $obj->setDataRecord($obj_rec);
67 $obj->read();
68 break;
69 }
70 return $obj;
71 }
Class ilSCORM2004Asset.
Class ilSCORM2004Chapter.
Class ilSCORM2004PageNode.
Class ilSCORM2004Sco.
Class ilSCORM2004Chapter.
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, and $query.

Referenced by ilSCORM2004Node\_deleteAllSLMNodes(), ilObjSCORM2004LearningModuleGUI\confirmedDelete(), ilSCORM2004Asset\delete_rec(), ilSCORM2004Chapter\delete_rec(), ilObjSCORM2004LearningModuleGUI\deleteNodes(), ilObjSCORM2004LearningModule\executeDragDrop(), ilObjectivesAlignmentTableGUI\fillRow(), ilSCORM2004NodeGUI\getNodeObject(), and ilObjSCORM2004LearningModuleGUI\saveAllTitles().

+ Here is the caller graph for this function:

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