public function get_course(event_interface $event) {
        if (is_null($this->courses)) {
            $this->load_courses();
        }

        if ($course = $event->get_course()) {
            $courseid = $course->get('id');
            return isset($this->courses[$courseid]) ? $this->courses[$courseid] : null;
        } else {
            return null;
        }
    }
public function get_course(event_interface $event) {
        if (is_null($this->courses)) {
            $this->load_courses();
        }

        if ($course = $event->get_course()) {
            $courseid = $course->get('id');
            return isset($this->courses[$courseid]) ? $this->courses[$courseid] : null;
        } else {
            return null;
        }
    }
public function get_course ( event_interface $ event ) { if ( is_null ( $ this -> courses ) ) { $ this -> load_courses ( ) ; } if ( $ course = $ event -> get_course ( ) ) { $ courseid = $ course -> get ( 'id' ) ; return isset ( $ this -> courses [ $ courseid ] ) ? $ this -> courses [ $ courseid ] : null ; } else { return null ; } }
Get the related course object for a given event.

@param event_interface $event The event object.
@return stdClass|null
Get the related course object for a given event .