Public Member Functions

ilLMObjectFactory Class Reference
[Modules/IliasLearningModule]

Class ilLMObjectFactory. More...

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.killing@gmx.de>
Version:
Id:
class.ilLMObjectFactory.php 11711 2006-07-30 14:11:38Z akill

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


Member Function Documentation

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;
        }

Here is the caller graph for this function:


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