EventListener/SuccessListener.php
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;
    }
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;
    }
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 ; }
Creates the result object from the user's input.

@param $form

@return Result
Creates the result object from the user s input .