ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilLMObjectFactory Class Reference

Class ilLMObjectFactory. More...

+ Collaboration diagram for ilLMObjectFactory:

Public Member Functions

 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()

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

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

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

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