ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLMObjectFactory Class Reference

Class ilLMObjectFactory. More...

+ Collaboration diagram for ilLMObjectFactory:

Static Public Member Functions

static getInstance (&$a_content_obj, $a_id=0, $a_halt=true)
 

Detailed Description

Class ilLMObjectFactory.

Creates StructureObject or PageObject by ID (see table lm_data)

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

Definition at line 37 of file class.ilLMObjectFactory.php.

Member Function Documentation

◆ getInstance()

static ilLMObjectFactory::getInstance ( $a_content_obj,
  $a_id = 0,
  $a_halt = true 
)
static

Definition at line 39 of file class.ilLMObjectFactory.php.

References $DIC, $ilDB, and $query.

Referenced by ilLMObject\_deleteAllObjectData(), ilObjContentObjectGUI\confirmedDelete(), ilStructureObject\delete_rec(), ilObjContentObjectGUI\executeCommand(), ilObjContentObject\executeDragDrop(), ilObjContentObject\fixTree(), ilLMPresentationGUI\ilLocator(), and ilLMObject\saveTitles().

40  {
41  global $DIC;
42 
43  $ilDB = $DIC->database();
44 
45  $query = "SELECT * FROM lm_data WHERE obj_id = " .
46  $ilDB->quote($a_id, "integer");
47  $obj_set = $ilDB->query($query);
48  $obj_rec = $ilDB->fetchAssoc($obj_set);
49 
50  switch ($obj_rec["type"]) {
51  case "st":
52  $obj = new ilStructureObject($a_content_obj);
53  $obj->setId($obj_rec["obj_id"]);
54  $obj->setDataRecord($obj_rec);
55  $obj->read();
56  break;
57 
58  case "pg":
59  $obj = new ilLMPageObject($a_content_obj, 0, $a_halt);
60  $obj->setId($obj_rec["obj_id"]);
61  $obj->setDataRecord($obj_rec);
62  $obj->read();
63  break;
64  }
65  return $obj;
66  }
global $DIC
Definition: saml.php:7
Class ilLMPageObject.
$query
Class ilStructreObject.
global $ilDB
+ Here is the caller graph for this function:

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