Return the lesson course module object.

@return stdClass course module
@since  Moodle 3.3
494892
public function get_cm() {
        if ($this->cm == null) {
            $this->cm = get_coursemodule_from_instance('lesson', $this->properties->id);
        }
        return $this->cm;
    }
383305
public function get_instance() {
        global $DB;
        if ($this->instance) {
            return $this->instance;
        }
        if ($this->get_course_module()) {
            $params = array('id' => $this->get_course_module()->instance);
            $this->instance = $DB->get_record('assign', $params, '*', MUST_EXIST);
        }
        if (!$this->instance) {
            throw new coding_exception('Improper use of the assignment class. ' .
                                       'Cannot load the assignment record.');
        }
        return $this->instance;
    }
304395
protected function getModuleTranslationPathFinder()
    {
        if (is_null($this->moduleTranslationPathFinder)) {
            $this->moduleTranslationPathFinder = oxNew(\OxidEsales\Eshop\Core\Module\ModuleTranslationPathFinder::class);
        }

        return $this->moduleTranslationPathFinder;
    }
424971
public function get_coursename() {
        return format_string($this->course->shortname, true, array(
            'context' => \context_course::instance($this->course->id),
        ));
    }
958045
public function get_url() {

        $url = new \moodle_url('/mod/forum/user.php', array('id' => $this->relateduserid,
            'mode' => $this->other['reportmode']));

        if ($this->courseid != SITEID) {
            $url->param('course', $this->courseid);
        }

        return $url;
    }
499342
public function define_course_plugin_structure() {
        global $DB;

        // Since this method is executed before the restore we can do some pre-checks here.
        // In case of merging backup into existing course find the current number of sections.
        $target = $this->step->get_task()->get_target();
        if (($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_ADDING) &&
                $this->is_pre_33_backup()) {
            $maxsection = $DB->get_field_sql(
                'SELECT max(section) FROM {course_sections} WHERE course = ?',
                [$this->step->get_task()->get_courseid()]);
            $this->originalnumsections = (int)$maxsection;
        }

        // Dummy path element is needed in order for after_restore_course() to be called.
        return [new restore_path_element('dummy_course', $this->get_pathfor('/dummycourse'))];
    }
1016566
final public static function getClassFile():\stdClass
    {
        $a = json_decode(file_get_contents(FEnv::get("framework.config.core.apps.file")));
        return ($a == null ? new \stdClass() : $a);
    }
648640
public static function create_from_course(\stdClass $course) {
        $params = array(
            'context' => \context_course::instance($course->id)
        );
        $event = \mod_assign\event\course_module_instance_list_viewed::create($params);
        $event->add_record_snapshot('course', $course);
        return $event;
    }
79354
public function get_url() {
        if ($this->courseid) {
            $cat = $this->other['newcategoryid'] . ',' . $this->contextid;
            if ($this->contextlevel == CONTEXT_MODULE) {
                return new \moodle_url('/question/edit.php',
                        ['cmid' => $this->contextinstanceid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
            }
            return new \moodle_url('/question/edit.php',
                    ['courseid' => $this->courseid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
        }
        // Lets try viewing from the frontpage for contexts above course.
        return new \moodle_url('/question/category.php',
                ['courseid' => SITEID, 'edit' => $this->other['newcategoryid'], 'lastchanged' => $this->objectid]);
    }
237305
public static SimpleModule getModule() {
        SimpleModule module = new SimpleModule();
        module.addSerializer(Headers.class, new HeadersSerializer());
        return module;
    }
1112288
protected function get_modules_recent_activity() {
        $context = context_course::instance($this->page->course->id);
        $viewfullnames = has_capability('moodle/site:viewfullnames', $context);
        $hascontent = false;

        $modinfo = get_fast_modinfo($this->page->course);
        $usedmodules = $modinfo->get_used_module_names();
        $recentactivity = array();
        foreach ($usedmodules as $modname => $modfullname) {
            // Each module gets it's own logs and prints them
            ob_start();
            $hascontent = component_callback('mod_'. $modname, 'print_recent_activity',
                    array($this->page->course, $viewfullnames, $this->get_timestart()), false);
            if ($hascontent) {
                $recentactivity[$modname] = ob_get_contents();
            }
            ob_end_clean();
        }
        return $recentactivity;
    }
23012
public function get_course() {
        global $DB;
        if (!$this->courseid) {
            return null;
        }
        if ($this->course === false) {
            $this->course = get_course($this->courseid);
            $options = $this->get_format_options();
            $dbcoursecolumns = null;
            foreach ($options as $optionname => $optionvalue) {
                if (isset($this->course->$optionname)) {
                    // Course format options must not have the same names as existing columns in db table "course".
                    if (!isset($dbcoursecolumns)) {
                        $dbcoursecolumns = $DB->get_columns('course');
                    }
                    if (isset($dbcoursecolumns[$optionname])) {
                        debugging('The option name '.$optionname.' in course format '.$this->format.
                            ' is invalid because the field with the same name exists in {course} table',
                            DEBUG_DEVELOPER);
                        continue;
                    }
                }
                $this->course->$optionname = $optionvalue;
            }
        }
        return $this->course;
    }
1297930
public function getModuleModel()
    {
        if ($this->_moduleModel === null) {
            // 默认根据缓存的模块数据生成模块model
            $class = $this->module->moduleModelClass;
            $model = new $class;
            $class::populateRecord($model, ModuleModel::models()[$this->id]);
            $this->setModuleModel($model);
        }
        return $this->_moduleModel;
    }
666498
public function get_url() {
        global $DB;

        if ($modname = $DB->get_field_sql("SELECT md.name AS modname
                                             FROM {course_modules} cm
                                             JOIN {modules} md ON md.id = cm.module
                                            WHERE cm.id = ?", array($this->_instanceid))) {
            return new moodle_url('/mod/' . $modname . '/view.php', array('id'=>$this->_instanceid));
        }

        return new moodle_url('/');
    }
110849
public function getModules(){
        if($this->loadModules != 'ALL'){
            $this->connection->select('name');
            $this->connection->from($this->tableModule);
            $modules= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC);
            foreach ($modules as $module) {
                $this->getModule($module['name']);
            }
            $this->loadModules= 'ALL';
        }
        return $this->modules;
    }
747752
public function getControllerClasses()
    {
        $moduleName = $this->getVarValue('moduleName', false);
    
        return (empty($moduleName) || !Yii::$app->hasModule($moduleName)) ? [] : Yii::$app->getModule($moduleName)->getControllerFiles();
    }
1354398
public function getDisabledModuleClasses()
    {
        $disabledModules = $this->getDisabledModules();
        $disabledModuleClasses = [];
        if (isset($disabledModules) && is_array($disabledModules)) {
            //get all disabled module paths
            $extensions = $this->getModuleConfigParametersByKey(static::MODULE_KEY_EXTENSIONS);
            $modules = $this->getModulesWithExtendedClass();
            $modulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS);

            foreach ($disabledModules as $moduleId) {
                if (!array_key_exists($moduleId, $extensions)) {
                    $path = $modulePaths[$moduleId];
                    if (!isset($path)) {
                        $path = $moduleId;
                    }
                    foreach ($modules as $moduleClasses) {
                        foreach ($moduleClasses as $moduleClass) {
                            if (strpos($moduleClass, $path . "/") === 0) {
                                $disabledModuleClasses[] = $moduleClass;
                            }
                        }
                    }
                } else {
                    $disabledModuleClasses = array_merge($disabledModuleClasses, $extensions[$moduleId]);
                }
            }
        }

        return $disabledModuleClasses;
    }