Public Member Functions | Data Fields

ilCourseObjectiveLM Class Reference

Public Member Functions

 ilCourseObjectiveLM ($a_objective_id)
 getLMs ()
 getChapters ()
 getLM ($lm_id)
 getObjectiveId ()
 setLMRefId ($a_ref_id)
 getLMRefId ()
 setLMObjId ($a_obj_id)
 getLMObjId ()
 setType ($a_type)
 getType ()
 checkExists ()
 add ()
 delete ($lm_id)
 deleteAll ()
 __read ()

Data Fields

 $db = null
 $objective_id = null
 $lms

Detailed Description

Definition at line 35 of file class.ilCourseObjectiveLM.php.


Member Function Documentation

ilCourseObjectiveLM::__read (  ) 

Definition at line 164 of file class.ilCourseObjectiveLM.php.

References $query, $res, $row, and $tree.

Referenced by ilCourseObjectiveLM().

        {
                global $tree;

                $this->lms = array();
                $query = "SELECT * FROM crs_objective_lm ".
                        "WHERE objective_id = '".$this->getObjectiveId()."'";

                $res = $this->db->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        if(!$tree->isInTree($row->ref_id))
                        {
                                $this->delete($row->lm_ass_id);
                                continue;
                        }
                        $lm['ref_id'] = $row->ref_id;
                        $lm['obj_id'] = $row->obj_id;
                        $lm['type'] = $row->type;
                        $lm['lm_ass_id'] = $row->lm_ass_id;

                        $this->lms[$row->lm_ass_id] = $lm;
                }
                return true;
        }

Here is the caller graph for this function:

ilCourseObjectiveLM::add (  ) 

Definition at line 126 of file class.ilCourseObjectiveLM.php.

References $query.

        {
                $query = "INSERT INTO crs_objective_lm ".
                        "SET objective_id = '".$this->getObjectiveId()."', ".
                        "ref_id = '".$this->getLMRefId()."', ".
                        "obj_id = '".$this->getLMObjId()."', ".
                        "type = '".$this->getType()."'";

                $this->db->query($query);

                return true;
        }

ilCourseObjectiveLM::checkExists (  ) 

Definition at line 105 of file class.ilCourseObjectiveLM.php.

References $query, $res, and getLMObjId().

        {
                if($this->getLMObjId())
                {
                        $query = "SELECT * FROM crs_objective_lm ".
                                "WHERE objective_id = '".$this->getObjectiveId()."' ".
                                "AND ref_id = '".$this->getLMRefId()."' ".
                                "AND obj_id = '".$this->getLMObjId()."'";
                }
                else
                {
                        $query = "SELECT * FROM crs_objective_lm ".
                                "WHERE objective_id = '".$this->getObjectiveId()."' ".
                                "AND ref_id = '".$this->getLMRefId()."'";
                }

                $res = $this->db->query($query);

                return $res->numRows() ? true : false;
        }

Here is the call graph for this function:

ilCourseObjectiveLM::delete ( lm_id  ) 

Definition at line 138 of file class.ilCourseObjectiveLM.php.

References $lm_id, and $query.

        {
                if(!$lm_id)
                {
                        return false;
                }

                $query = "DELETE FROM crs_objective_lm ".
                        "WHERE lm_ass_id = '".$lm_id."'";

                $this->db->query($query);

                return true;
        }

ilCourseObjectiveLM::deleteAll (  ) 

Definition at line 153 of file class.ilCourseObjectiveLM.php.

References $query.

        {
                $query = "DELETE FROM crs_objective_lm ".
                        "WHERE objective_id = '".$this->getObjectiveId()."'";

                $this->db->query($query);

                return true;
        }

ilCourseObjectiveLM::getChapters (  ) 

Definition at line 58 of file class.ilCourseObjectiveLM.php.

        {
                foreach($this->lms as $lm_data)
                {
                        if($lm_data['type'] == 'st')
                        {
                                $chapters[] = $lm_data;
                        }
                }
                return $chapters ? $chapters : array();
        }

ilCourseObjectiveLM::getLM ( lm_id  ) 

Definition at line 70 of file class.ilCourseObjectiveLM.php.

References $lm_id.

        {
                return $this->lms[$lm_id] ? $this->lms[$lm_id] : array();
        }

ilCourseObjectiveLM::getLMObjId (  ) 

Definition at line 92 of file class.ilCourseObjectiveLM.php.

Referenced by checkExists().

        {
                return $this->lm_obj_id ? $this->lm_obj_id : 0;
        }

Here is the caller graph for this function:

ilCourseObjectiveLM::getLMRefId (  ) 

Definition at line 84 of file class.ilCourseObjectiveLM.php.

        {
                return $this->lm_ref_id ? $this->lm_ref_id : 0;
        }

ilCourseObjectiveLM::getLMs (  ) 

Definition at line 53 of file class.ilCourseObjectiveLM.php.

        {
                return $this->lms ? $this->lms : array();
        }

ilCourseObjectiveLM::getObjectiveId (  ) 

Definition at line 75 of file class.ilCourseObjectiveLM.php.

        {
                return $this->objective_id;
        }

ilCourseObjectiveLM::getType (  ) 

Definition at line 100 of file class.ilCourseObjectiveLM.php.

        {
                return $this->type;
        }

ilCourseObjectiveLM::ilCourseObjectiveLM ( a_objective_id  ) 

Definition at line 42 of file class.ilCourseObjectiveLM.php.

References __read().

        {
                global $ilDB;

                $this->db =& $ilDB;
        
                $this->objective_id = $a_objective_id;

                $this->__read();
        }

Here is the call graph for this function:

ilCourseObjectiveLM::setLMObjId ( a_obj_id  ) 

Definition at line 88 of file class.ilCourseObjectiveLM.php.

        {
                $this->lm_obj_id = $a_obj_id;
        }

ilCourseObjectiveLM::setLMRefId ( a_ref_id  ) 

Definition at line 80 of file class.ilCourseObjectiveLM.php.

        {
                $this->lm_ref_id = $a_ref_id;
        }

ilCourseObjectiveLM::setType ( a_type  ) 

Definition at line 96 of file class.ilCourseObjectiveLM.php.

        {
                $this->type = $a_type;
        }


Field Documentation

ilCourseObjectiveLM::$db = null

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

ilCourseObjectiveLM::$lms

Definition at line 40 of file class.ilCourseObjectiveLM.php.

ilCourseObjectiveLM::$objective_id = null

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


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