original_string: public function createResult(Form $form)
      {
          $result = new Result();
          $result->setDatetimeAdded(new \DateTime());
  
          $viewData = $form->getSf2Form()->getViewData();
  
          foreach ($form->getFields() as $field) {
              $entry = new Entry();
              $entry->setField($field);
              $entry->setValue($viewData['field_'.$field->getId()]);
              $result->addEntry($entry);
          }
  
          return $result;
      }
code: public function createResult(Form $form)
      {
          $result = new Result();
          $result->setDatetimeAdded(new \DateTime());
  
          $viewData = $form->getSf2Form()->getViewData();
  
          foreach ($form->getFields() as $field) {
              $entry = new Entry();
              $entry->setField($field);
              $entry->setValue($viewData['field_'.$field->getId()]);
              $result->addEntry($entry);
          }
  
          return $result;
      }
code_tokens: public function createResult ( Form $ form ) { $ result = new Result ( ) ; $ result -> setDatetimeAdded ( new \ DateTime ( ) ) ; $ viewData = $ form -> getSf2Form ( ) -> getViewData ( ) ; foreach ( $ form -> getFields ( ) as $ field ) { $ entry = new Entry ( ) ; $ entry -> setField ( $ field ) ; $ entry -> setValue ( $ viewData [ 'field_' . $ field -> getId ( ) ] ) ; $ result -> addEntry ( $ entry ) ; } return $ result ; }
docstring: Creates the result object from the user's input.
  
  @param $form
  
  @return Result
docstring_tokens: Creates the result object from the user s input .