W3cubDocs

/Symfony 2.7

Symfony\Component\Form\Extension\Core\DataTransformer\ValueToDuplicatesTransformer

class ValueToDuplicatesTransformer implements DataTransformerInterface

Methods

__construct(array $keys)
array transform(mixed $value)

Duplicates the given value through the array.

mixed reverseTransform(array $array)

Extracts the duplicated value from an array.

Details

public __construct(array $keys)

Parameters

array $keys

public array transform(mixed $value)

Duplicates the given value through the array.

Parameters

mixed $value The value

Return Value

array The array

public mixed reverseTransform(array $array)

Extracts the duplicated value from an array.

Parameters

array $array

Return Value

mixed The value

Exceptions

TransformationFailedException If the given value is not an array or if the given array can not be transformed.