original_string: public function setFormValues($data = null)
      {
          if ($data === null) {
              $data = $this->getSaveData();
          }
  
          /*
           * Fill the model as if it were to be saved
           */
          $this->prepareModelsToSave($this->model, $data);
  
          /*
           * Data set differs from model
           */
          if ($this->data !== $this->model) {
              $this->data = (object) array_merge((array) $this->data, (array) $data);
          }
  
          /*
           * Set field values from data source
           */
          foreach ($this->allFields as $field) {
              $field->value = $this->getFieldValue($field);
          }
  
          return $data;
      }
code: public function setFormValues($data = null)
      {
          if ($data === null) {
              $data = $this->getSaveData();
          }
  
          /*
           * Fill the model as if it were to be saved
           */
          $this->prepareModelsToSave($this->model, $data);
  
          /*
           * Data set differs from model
           */
          if ($this->data !== $this->model) {
              $this->data = (object) array_merge((array) $this->data, (array) $data);
          }
  
          /*
           * Set field values from data source
           */
          foreach ($this->allFields as $field) {
              $field->value = $this->getFieldValue($field);
          }
  
          return $data;
      }
code_tokens: public function setFormValues ( $ data = null ) { if ( $ data === null ) { $ data = $ this -> getSaveData ( ) ; } /*
           * Fill the model as if it were to be saved
           */ $ this -> prepareModelsToSave ( $ this -> model , $ data ) ; /*
           * Data set differs from model
           */ if ( $ this -> data !== $ this -> model ) { $ this -> data = ( object ) array_merge ( ( array ) $ this -> data , ( array ) $ data ) ; } /*
           * Set field values from data source
           */ foreach ( $ this -> allFields as $ field ) { $ field -> value = $ this -> getFieldValue ( $ field ) ; } return $ data ; }
docstring: Sets or resets form field values.
  @param array $data
  @return array
docstring_tokens: Sets or resets form field values .