original_string: protected function prepare_form_fields(array $dims, array $maps) {
  
          $formdata = new stdclass();
          $key = 0;
          foreach ($dims as $dimension) {
              $formdata->{'dimensionid__idx_' . $key}             = $dimension->id;
              $formdata->{'description__idx_' . $key}             = $dimension->description;
              $formdata->{'description__idx_' . $key.'format'}    = $dimension->descriptionformat;
              $formdata->{'grade0__idx_' . $key}                  = $dimension->grade0;
              $formdata->{'grade1__idx_' . $key}                  = $dimension->grade1;
              $formdata->{'weight__idx_' . $key}                  = $dimension->weight;
              $key++;
          }
  
          foreach ($maps as $nonegative => $map) {
              $formdata->{'map__idx_' . $nonegative} = $map->grade;
          }
  
          return $formdata;
      }
code: protected function prepare_form_fields(array $dims, array $maps) {
  
          $formdata = new stdclass();
          $key = 0;
          foreach ($dims as $dimension) {
              $formdata->{'dimensionid__idx_' . $key}             = $dimension->id;
              $formdata->{'description__idx_' . $key}             = $dimension->description;
              $formdata->{'description__idx_' . $key.'format'}    = $dimension->descriptionformat;
              $formdata->{'grade0__idx_' . $key}                  = $dimension->grade0;
              $formdata->{'grade1__idx_' . $key}                  = $dimension->grade1;
              $formdata->{'weight__idx_' . $key}                  = $dimension->weight;
              $key++;
          }
  
          foreach ($maps as $nonegative => $map) {
              $formdata->{'map__idx_' . $nonegative} = $map->grade;
          }
  
          return $formdata;
      }
code_tokens: protected function prepare_form_fields ( array $ dims , array $ maps ) { $ formdata = new stdclass ( ) ; $ key = 0 ; foreach ( $ dims as $ dimension ) { $ formdata -> { 'dimensionid__idx_' . $ key } = $ dimension -> id ; $ formdata -> { 'description__idx_' . $ key } = $ dimension -> description ; $ formdata -> { 'description__idx_' . $ key . 'format' } = $ dimension -> descriptionformat ; $ formdata -> { 'grade0__idx_' . $ key } = $ dimension -> grade0 ; $ formdata -> { 'grade1__idx_' . $ key } = $ dimension -> grade1 ; $ formdata -> { 'weight__idx_' . $ key } = $ dimension -> weight ; $ key ++ ; } foreach ( $ maps as $ nonegative => $ map ) { $ formdata -> { 'map__idx_' . $ nonegative } = $ map -> grade ; } return $ formdata ; }
docstring: Prepares the database data to be used by the mform
  
  @param array $dims Array of raw dimension records as returned by {@link load_fields()}
  @param array $maps Array of raw mapping records as returned by {@link load_mappings()}
  @return array Array of fields data to be used by the mform set_data
docstring_tokens: Prepares the database data to be used by the mform