bundle/Form/DataMapper/InformationCollectionMapper.php
protected function mapFromForm(
        FormInterface $form,
        DataWrapper $data,
        PropertyPathInterface $propertyPath
    ) {
        /** @var InformationCollectionStruct $payload */
        $payload = $data->payload;
        /** @var ContentType $contentType */
        $contentType = $data->definition;

        $fieldDefinitionIdentifier = (string) $propertyPath;
        $fieldDefinition = $contentType->getFieldDefinition($fieldDefinitionIdentifier);

        if (null === $fieldDefinition) {
            throw new RuntimeException(
                "Data definition does not contain expected FieldDefinition '{$fieldDefinitionIdentifier}'"
            );
        }

        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;
        $handler = $this->fieldTypeHandlerRegistry->get($fieldTypeIdentifier);

        $payload->setCollectedFieldValue(
            $fieldDefinitionIdentifier,
            $handler->convertFieldValueFromForm($form->getData())
        );
    }
protected function mapFromForm(
        FormInterface $form,
        DataWrapper $data,
        PropertyPathInterface $propertyPath
    ) {
        /** @var InformationCollectionStruct $payload */
        $payload = $data->payload;
        /** @var ContentType $contentType */
        $contentType = $data->definition;

        $fieldDefinitionIdentifier = (string) $propertyPath;
        $fieldDefinition = $contentType->getFieldDefinition($fieldDefinitionIdentifier);

        if (null === $fieldDefinition) {
            throw new RuntimeException(
                "Data definition does not contain expected FieldDefinition '{$fieldDefinitionIdentifier}'"
            );
        }

        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;
        $handler = $this->fieldTypeHandlerRegistry->get($fieldTypeIdentifier);

        $payload->setCollectedFieldValue(
            $fieldDefinitionIdentifier,
            $handler->convertFieldValueFromForm($form->getData())
        );
    }
protected function mapFromForm ( FormInterface $ form , DataWrapper $ data , PropertyPathInterface $ propertyPath ) { /** @var InformationCollectionStruct $payload */ $ payload = $ data -> payload ; /** @var ContentType $contentType */ $ contentType = $ data -> definition ; $ fieldDefinitionIdentifier = ( string ) $ propertyPath ; $ fieldDefinition = $ contentType -> getFieldDefinition ( $ fieldDefinitionIdentifier ) ; if ( null === $ fieldDefinition ) { throw new RuntimeException ( "Data definition does not contain expected FieldDefinition '{$fieldDefinitionIdentifier}'" ) ; } $ fieldTypeIdentifier = $ fieldDefinition -> fieldTypeIdentifier ; $ handler = $ this -> fieldTypeHandlerRegistry -> get ( $ fieldTypeIdentifier ) ; $ payload -> setCollectedFieldValue ( $ fieldDefinitionIdentifier , $ handler -> convertFieldValueFromForm ( $ form -> getData ( ) ) ) ; }
Maps data from form to the eZ Publish structure.

@param \Symfony\Component\Form\FormInterface $form
@param \Netgen\Bundle\EzFormsBundle\Form\DataWrapper $data
@param \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath
Maps data from form to the eZ Publish structure .