original_string: public function getSaveData()
      {
          $this->defineFormFields();
  
          $result = [];
  
          /*
           * Source data
           */
          $data = $this->arrayName ? post($this->arrayName) : post();
          if (!$data) {
              $data = [];
          }
  
          /*
           * Spin over each field and extract the postback value
           */
          foreach ($this->allFields as $field) {
              /*
               * Disabled and hidden should be omitted from data set
               */
              if ($field->disabled || $field->hidden) {
                  continue;
              }
  
              /*
               * Handle HTML array, eg: item[key][another]
               */
              $parts = HtmlHelper::nameToArray($field->fieldName);
              if (($value = $this->dataArrayGet($data, $parts)) !== null) {
  
                  /*
                   * Number fields should be converted to integers
                   */
                  if ($field->type === 'number') {
                      $value = !strlen(trim($value)) ? null : (float) $value;
                  }
  
                  $this->dataArraySet($result, $parts, $value);
              }
          }
  
          /*
           * Give widgets an opportunity to process the data.
           */
          foreach ($this->formWidgets as $field => $widget) {
              $parts = HtmlHelper::nameToArray($field);
  
              $widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
              $this->dataArraySet($result, $parts, $widgetValue);
          }
  
          return $result;
      }
code: public function getSaveData()
      {
          $this->defineFormFields();
  
          $result = [];
  
          /*
           * Source data
           */
          $data = $this->arrayName ? post($this->arrayName) : post();
          if (!$data) {
              $data = [];
          }
  
          /*
           * Spin over each field and extract the postback value
           */
          foreach ($this->allFields as $field) {
              /*
               * Disabled and hidden should be omitted from data set
               */
              if ($field->disabled || $field->hidden) {
                  continue;
              }
  
              /*
               * Handle HTML array, eg: item[key][another]
               */
              $parts = HtmlHelper::nameToArray($field->fieldName);
              if (($value = $this->dataArrayGet($data, $parts)) !== null) {
  
                  /*
                   * Number fields should be converted to integers
                   */
                  if ($field->type === 'number') {
                      $value = !strlen(trim($value)) ? null : (float) $value;
                  }
  
                  $this->dataArraySet($result, $parts, $value);
              }
          }
  
          /*
           * Give widgets an opportunity to process the data.
           */
          foreach ($this->formWidgets as $field => $widget) {
              $parts = HtmlHelper::nameToArray($field);
  
              $widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
              $this->dataArraySet($result, $parts, $widgetValue);
          }
  
          return $result;
      }
code_tokens: public function getSaveData ( ) { $ this -> defineFormFields ( ) ; $ result = [ ] ; /*
           * Source data
           */ $ data = $ this -> arrayName ? post ( $ this -> arrayName ) : post ( ) ; if ( ! $ data ) { $ data = [ ] ; } /*
           * Spin over each field and extract the postback value
           */ foreach ( $ this -> allFields as $ field ) { /*
               * Disabled and hidden should be omitted from data set
               */ if ( $ field -> disabled || $ field -> hidden ) { continue ; } /*
               * Handle HTML array, eg: item[key][another]
               */ $ parts = HtmlHelper :: nameToArray ( $ field -> fieldName ) ; if ( ( $ value = $ this -> dataArrayGet ( $ data , $ parts ) ) !== null ) { /*
                   * Number fields should be converted to integers
                   */ if ( $ field -> type === 'number' ) { $ value = ! strlen ( trim ( $ value ) ) ? null : ( float ) $ value ; } $ this -> dataArraySet ( $ result , $ parts , $ value ) ; } } /*
           * Give widgets an opportunity to process the data.
           */ foreach ( $ this -> formWidgets as $ field => $ widget ) { $ parts = HtmlHelper :: nameToArray ( $ field ) ; $ widgetValue = $ widget -> getSaveValue ( $ this -> dataArrayGet ( $ result , $ parts ) ) ; $ this -> dataArraySet ( $ result , $ parts , $ widgetValue ) ; } return $ result ; }
docstring: Returns post data from a submitted form.
  
  @return array
docstring_tokens: Returns post data from a submitted form .