W3cubDocs

/Symfony 2.8

Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer

class CollectionToArrayTransformer implements DataTransformerInterface

Methods

mixed transform(Collection $collection)

Transforms a collection into an array.

Collection reverseTransform(mixed $array)

Transforms choice keys into entities.

Details

public mixed transform(Collection $collection)

Transforms a collection into an array.

Parameters

Collection $collection A collection of entities

Return Value

mixed An array of entities

Exceptions

TransformationFailedException

public Collection reverseTransform(mixed $array)

Transforms choice keys into entities.

Parameters

mixed $array An array of entities

Return Value

Collection A collection of entities