ChoicesToValuesTransformer
class ChoicesToValuesTransformer implements DataTransformerInterface
Methods
| __construct(ChoiceListInterface $choiceList) Constructor. | ||
| mixed | transform(array $array) | |
| mixed | reverseTransform(array $array) |
Details
__construct(ChoiceListInterface $choiceList)
Constructor.
Parameters
| ChoiceListInterface | $choiceList |
mixed transform(array $array)
Parameters
| array | $array |
Return Value
| mixed | The value in the transformed representation |
Exceptions
| TransformationFailedException | If the given value is not an array. |
mixed reverseTransform(array $array)
Parameters
| array | $array |
Return Value
| mixed | 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. |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.html