ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 39 of file class.ilSCORM2004NodeFactory.php.

Member Function Documentation

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

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

References $ilDB, and $query.

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

{
global $ilias, $ilDB;
$query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
$ilDB->quote($a_id, "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $ilDB->fetchAssoc($obj_set);
$obj = null;
switch($obj_rec["type"])
{
case "chap":
$obj =& new ilSCORM2004Chapter($a_slm_object);
$obj->setId($obj_rec["obj_id"]);
$obj->setDataRecord($obj_rec);
$obj->read();
break;
case "seqc":
$obj =& new ilSCORM2004SeqChapter($a_slm_object);
$obj->setId($obj_rec["obj_id"]);
$obj->setDataRecord($obj_rec);
$obj->read();
break;
case "sco":
$obj =& new ilSCORM2004Sco($a_slm_object);
$obj->setId($obj_rec["obj_id"]);
$obj->setDataRecord($obj_rec);
$obj->read();
break;
case "page":
$obj =& new ilSCORM2004PageNode($a_slm_object, 0, $a_halt);
$obj->setId($obj_rec["obj_id"]);
$obj->setDataRecord($obj_rec);
$obj->read();
break;
}
return $obj;
}

+ Here is the caller graph for this function:


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