W3cubDocs

/Symfony 4.1

PropertyPathMapper

class PropertyPathMapper implements DataMapperInterface

Maps arrays/objects to/from forms using property paths.

Methods

__construct(PropertyAccessorInterface $propertyAccessor = null)
mapDataToForms(mixed $data, FormInterface[]|Traversable $forms)

Maps properties of some data to a list of forms.

mapFormsToData(FormInterface[]|Traversable $forms, mixed $data)

Maps the data of a list of forms into the properties of some data.

Details

__construct(PropertyAccessorInterface $propertyAccessor = null)

Parameters

PropertyAccessorInterface $propertyAccessor

mapDataToForms(mixed $data, FormInterface[]|Traversable $forms)

Maps properties of some data to a list of forms.

Parameters

mixed $data Structured data
FormInterface[]|Traversable $forms A list of {@link FormInterface} instances

Exceptions

UnexpectedTypeException if the type of the data parameter is not supported

mapFormsToData(FormInterface[]|Traversable $forms, mixed $data)

Maps the data of a list of forms into the properties of some data.

Parameters

FormInterface[]|Traversable $forms A list of {@link FormInterface} instances
mixed $data Structured data

Exceptions

UnexpectedTypeException if the type of the data parameter is not supported