symfony / 4.1.7 / symfony / bridge / doctrine / form / datatransformer / collectiontoarraytransformer.html /

CollectionToArrayTransformer

class CollectionToArrayTransformer implements DataTransformerInterface

Methods

mixed transform($collection)

Transforms a collection into an array.

mixed reverseTransform(mixed $array)

Transforms choice keys into entities.

Details

mixed transform($collection)

Transforms a collection into an array.

Parameters

$collection

Return Value

mixed The value in the transformed representation

Exceptions

TransformationFailedException

mixed reverseTransform(mixed $array)

Transforms choice keys into entities.

Parameters

mixed $array An array of entities

Return Value

mixed The value in the original representation