original_string: public function get_course_module() {
          if ($this->coursemodule) {
              return $this->coursemodule;
          }
          if (!$this->context) {
              return null;
          }
  
          if ($this->context->contextlevel == CONTEXT_MODULE) {
              $modinfo = get_fast_modinfo($this->get_course());
              $this->coursemodule = $modinfo->get_cm($this->context->instanceid);
              return $this->coursemodule;
          }
          return null;
      }
code: public function get_course_module() {
          if ($this->coursemodule) {
              return $this->coursemodule;
          }
          if (!$this->context) {
              return null;
          }
  
          if ($this->context->contextlevel == CONTEXT_MODULE) {
              $modinfo = get_fast_modinfo($this->get_course());
              $this->coursemodule = $modinfo->get_cm($this->context->instanceid);
              return $this->coursemodule;
          }
          return null;
      }
code_tokens: public function get_course_module ( ) { if ( $ this -> coursemodule ) { return $ this -> coursemodule ; } if ( ! $ this -> context ) { return null ; } if ( $ this -> context -> contextlevel == CONTEXT_MODULE ) { $ modinfo = get_fast_modinfo ( $ this -> get_course ( ) ) ; $ this -> coursemodule = $ modinfo -> get_cm ( $ this -> context -> instanceid ) ; return $ this -> coursemodule ; } return null ; }
docstring: Get the current course module.
  
  @return cm_info|null The course module or null if not known
docstring_tokens: Get the current course module .