ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 15 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 17 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().

18  {
19  global $DIC;
20 
21  $ilDB = $DIC->database();
22 
23  $query = "SELECT * FROM lm_data WHERE obj_id = " .
24  $ilDB->quote($a_id, "integer");
25  $obj_set = $ilDB->query($query);
26  $obj_rec = $ilDB->fetchAssoc($obj_set);
27 
28  switch ($obj_rec["type"]) {
29  case "st":
30  $obj = new ilStructureObject($a_content_obj);
31  $obj->setId($obj_rec["obj_id"]);
32  $obj->setDataRecord($obj_rec);
33  $obj->read();
34  break;
35 
36  case "pg":
37  $obj = new ilLMPageObject($a_content_obj, 0, $a_halt);
38  $obj->setId($obj_rec["obj_id"]);
39  $obj->setDataRecord($obj_rec);
40  $obj->read();
41  break;
42  }
43  return $obj;
44  }
Class ilLMPageObject.
$query
Class ilStructreObject.
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

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