public function get_course() {
        global $DB;

        if ($this->course) {
            return $this->course;
        }

        if (!$this->context) {
            return null;
        }
        $params = array('id' => $this->get_course_context()->instanceid);
        $this->course = $DB->get_record('course', $params, '*', MUST_EXIST);

        return $this->course;
    }
public function get_course() {
        global $DB;

        if ($this->course) {
            return $this->course;
        }

        if (!$this->context) {
            return null;
        }
        $params = array('id' => $this->get_course_context()->instanceid);
        $this->course = $DB->get_record('course', $params, '*', MUST_EXIST);

        return $this->course;
    }
public function get_course ( ) { global $ DB ; if ( $ this -> course ) { return $ this -> course ; } if ( ! $ this -> context ) { return null ; } $ params = array ( 'id' => $ this -> get_course_context ( ) -> instanceid ) ; $ this -> course = $ DB -> get_record ( 'course' , $ params , '*' , MUST_EXIST ) ; return $ this -> course ; }
Get the current course.

@return mixed stdClass|null The course
Get the current course .