original_string: public function get_course_module_record($additionalfields = false) {
          $cmrecord = new stdClass();
  
          // Standard fields from table course_modules.
          static $cmfields = array('id', 'course', 'module', 'instance', 'section', 'idnumber', 'added',
              'score', 'indent', 'visible', 'visibleoncoursepage', 'visibleold', 'groupmode', 'groupingid',
              'completion', 'completiongradeitemnumber', 'completionview', 'completionexpected',
              'showdescription', 'availability', 'deletioninprogress');
          foreach ($cmfields as $key) {
              $cmrecord->$key = $this->$key;
          }
  
          // Additional fields that function get_coursemodule_from_id() adds.
          if ($additionalfields) {
              $cmrecord->name = $this->name;
              $cmrecord->modname = $this->modname;
              $cmrecord->sectionnum = $this->sectionnum;
          }
  
          return $cmrecord;
      }
code: public function get_course_module_record($additionalfields = false) {
          $cmrecord = new stdClass();
  
          // Standard fields from table course_modules.
          static $cmfields = array('id', 'course', 'module', 'instance', 'section', 'idnumber', 'added',
              'score', 'indent', 'visible', 'visibleoncoursepage', 'visibleold', 'groupmode', 'groupingid',
              'completion', 'completiongradeitemnumber', 'completionview', 'completionexpected',
              'showdescription', 'availability', 'deletioninprogress');
          foreach ($cmfields as $key) {
              $cmrecord->$key = $this->$key;
          }
  
          // Additional fields that function get_coursemodule_from_id() adds.
          if ($additionalfields) {
              $cmrecord->name = $this->name;
              $cmrecord->modname = $this->modname;
              $cmrecord->sectionnum = $this->sectionnum;
          }
  
          return $cmrecord;
      }
code_tokens: public function get_course_module_record ( $ additionalfields = false ) { $ cmrecord = new stdClass ( ) ; // Standard fields from table course_modules. static $ cmfields = array ( 'id' , 'course' , 'module' , 'instance' , 'section' , 'idnumber' , 'added' , 'score' , 'indent' , 'visible' , 'visibleoncoursepage' , 'visibleold' , 'groupmode' , 'groupingid' , 'completion' , 'completiongradeitemnumber' , 'completionview' , 'completionexpected' , 'showdescription' , 'availability' , 'deletioninprogress' ) ; foreach ( $ cmfields as $ key ) { $ cmrecord -> $ key = $ this -> $ key ; } // Additional fields that function get_coursemodule_from_id() adds. if ( $ additionalfields ) { $ cmrecord -> name = $ this -> name ; $ cmrecord -> modname = $ this -> modname ; $ cmrecord -> sectionnum = $ this -> sectionnum ; } return $ cmrecord ; }
docstring: Returns itself in the form of stdClass.
  
  The object includes all fields that table course_modules has and additionally
  fields 'name', 'modname', 'sectionnum' (if requested).
  
  This can be used as a faster alternative to {@link get_coursemodule_from_id()}
  
  @param bool $additionalfields include additional fields 'name', 'modname', 'sectionnum'
  @return stdClass
docstring_tokens: Returns itself in the form of stdClass .