private function setup_course($courseid) {
        global $PAGE, $DB;
        if (!empty($this->course) && $this->course->id == $courseid) {
            // already set, stop
            return;
        }
        if ($courseid == $PAGE->course->id) {
            $this->course = $PAGE->course;
        } else if (!$this->course = $DB->get_record('course', array('id' => $courseid))) {
            $this->course = null;
        }
    }
private function setup_course($courseid) {
        global $PAGE, $DB;
        if (!empty($this->course) && $this->course->id == $courseid) {
            // already set, stop
            return;
        }
        if ($courseid == $PAGE->course->id) {
            $this->course = $PAGE->course;
        } else if (!$this->course = $DB->get_record('course', array('id' => $courseid))) {
            $this->course = null;
        }
    }
private function setup_course ( $ courseid ) { global $ PAGE , $ DB ; if ( ! empty ( $ this -> course ) && $ this -> course -> id == $ courseid ) { // already set, stop return ; } if ( $ courseid == $ PAGE -> course -> id ) { $ this -> course = $ PAGE -> course ; } else if ( ! $ this -> course = $ DB -> get_record ( 'course' , array ( 'id' => $ courseid ) ) ) { $ this -> course = null ; } }
Records the course object

@global moodle_page $PAGE
@global moodle_database $DB
@param int $courseid
Records the course object