Symfony2 API
Class

Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer

class ChoicesToValuesTransformer implements DataTransformerInterface

Methods

__construct(ChoiceListInterface $choiceList)

Constructor.

array transform(array $array)

array reverseTransform(array $array)

Details

at line 31
public __construct(ChoiceListInterface $choiceList)

Constructor.

Parameters

ChoiceListInterface $choiceList

at line 43
public array transform(array $array)

Parameters

array $array

Return Value

array The value in the transformed representation

Exceptions

TransformationFailedException If the given value is not an array.

at line 65
public array reverseTransform(array $array)

Parameters

array $array

Return Value

array The value in the original representation

Exceptions

TransformationFailedException If the given value is not an array or if no matching choice could be found for some given value.