private function get_mod_instance($cmid) {
        global $DB;
        $rec = $DB->get_record_sql("SELECT md.name
                               FROM {course_modules} cm,
                                    {modules} md
                               WHERE cm.id = ? AND
                                     md.id = cm.module", array($cmid));

        if ($rec) {
            return get_coursemodule_from_id($rec->name, $cmid);
        } else {
            return null;
        }
    }
private function get_mod_instance($cmid) {
        global $DB;
        $rec = $DB->get_record_sql("SELECT md.name
                               FROM {course_modules} cm,
                                    {modules} md
                               WHERE cm.id = ? AND
                                     md.id = cm.module", array($cmid));

        if ($rec) {
            return get_coursemodule_from_id($rec->name, $cmid);
        } else {
            return null;
        }
    }
private function get_mod_instance ( $ cmid ) { global $ DB ; $ rec = $ DB -> get_record_sql ( "SELECT md.name
                               FROM {course_modules} cm,
                                    {modules} md
                               WHERE cm.id = ? AND
                                     md.id = cm.module" , array ( $ cmid ) ) ; if ( $ rec ) { return get_coursemodule_from_id ( $ rec -> name , $ cmid ) ; } else { return null ; } }
Gets the module instance from the database and returns it.
If no module instance exists this function returns false.

@return stdClass|bool
Gets the module instance from the database and returns it . If no module instance exists this function returns false .