ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLMObjectFactory Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLMObjectFactory:

Static Public Member Functions

static getInstance (ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilLMObjectFactory Creates StructureObject or PageObject by ID (see table lm_data)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ getInstance()

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

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

31 : ?ilLMObject {
32 global $DIC;
33
34 $ilDB = $DIC->database();
35
36 $query = "SELECT * FROM lm_data WHERE obj_id = " .
37 $ilDB->quote($a_id, "integer");
38 $obj_set = $ilDB->query($query);
39 $obj_rec = $ilDB->fetchAssoc($obj_set);
40
41 $obj = null;
42 if ($obj_rec) {
43 switch ($obj_rec["type"]) {
44 case "st":
45 $obj = new ilStructureObject($a_content_obj);
46 $obj->setId($obj_rec["obj_id"]);
47 $obj->setDataRecord($obj_rec);
48 $obj->read();
49 break;
50
51 case "pg":
52 $obj = new ilLMPageObject($a_content_obj, 0, $a_halt);
53 $obj->setId($obj_rec["obj_id"]);
54 $obj->setDataRecord($obj_rec);
55 $obj->read();
56 break;
57 }
58 }
59 return $obj;
60 }
Class ilLMObject.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26

Referenced by ilLMObject\_deleteAllObjectData(), ilObjContentObjectGUI\confirmedDelete(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\confirmedDelete(), ilStructureObject\delete_rec(), ilObjContentObject\fixTree(), and ilLMPresentationGUI\ilLocator().

+ Here is the caller graph for this function:

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