Class ilLMObjectFactory. More...
Public Member Functions | |
getInstance (&$a_content_obj, $a_id=0, $a_halt=true) |
Class ilLMObjectFactory.
Creates StructureObject or PageObject by ID (see table lm_data)
Definition at line 37 of file class.ilLMObjectFactory.php.
ilLMObjectFactory::getInstance | ( | &$ | a_content_obj, | |
$ | a_id = 0 , |
|||
$ | a_halt = true | |||
) |
Definition at line 39 of file class.ilLMObjectFactory.php.
References $ilias, and $query.
Referenced by ilSearchGUI::__formatDigiLibResult(), ilSearchGUI::__formatLearningModuleResult(), ilSearchGUI::__save(), ilLMObject::_deleteAllObjectData(), ilCourseObjectivesGUI::askDeleteLM(), ilCourseObjectivesGUI::assignChapterSelect(), ilObjContentObjectGUI::confirmedDelete(), ilStructureObject::copy(), ilStructureObjectGUI::cutPage(), ilStructureObject::delete_rec(), ilObjContentObjectGUI::executeCommand(), ilLMPresentationGUI::ilLocator(), ilCourseObjectivesGUI::listAssignedLM(), ilObjContentObjectGUI::pasteChapter(), ilObjContentObjectGUI::proceedDragDrop(), and ilWysiwygUtil::showMoveCopyQuestion().
{ global $ilias; $query = "SELECT * FROM lm_data WHERE obj_id = '$a_id'"; $obj_set = $ilias->db->query($query); $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC); switch($obj_rec["type"]) { case "st": $obj =& new ilStructureObject($a_content_obj); $obj->setId($obj_rec["obj_id"]); $obj->setDataRecord($obj_rec); $obj->read(); break; case "pg": $obj =& new ilLMPageObject($a_content_obj, 0, $a_halt); $obj->setId($obj_rec["obj_id"]); $obj->setDataRecord($obj_rec); $obj->read(); break; } return $obj; }