ChoiceToValueTransformer

class ChoiceToValueTransformer implements DataTransformerInterface Methods __construct(ChoiceListInterface $choiceList) Constructor. mixed transform($choice) Transforms a value from the original representation to a transformed representation. mixed reverseTransform(mixed $value) Transforms a value from the transformed representation to its original representation. Details __construct(ChoiceListInterface $choiceList) Constructor. Para

ChoiceToValueTransformer::reverseTransform()

mixed reverseTransform(mixed $value) Transforms a value from the transformed representation to its original representation. This method is called when {@link Form::submit()} is called to transform the requests tainted data into an acceptable format for your data processing/model layer. This method must be able to deal with empty values. Usually this will be an empty string, but depending on your implementation other empty values are possible as well (such as NULL). The reasoning

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 val

ChoiceToBooleanArrayTransformer deprecated

class ChoiceToBooleanArrayTransformer implements DataTransformerInterface deprecated since version 2.7, to be removed in 3.0. Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead. Methods __construct(ChoiceListInterface $choiceList, bool $placeholderPresent) Constructor. mixed transform(mixed $choice) Transforms a single choice to a format appropriate for the nested checkboxes/radio buttons. mixed reverseTransform(array $values) Transforms a checkbox/radio bu

ChoicesToValuesTransformer::reverseTransform()

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.

ChoicesToValuesTransformer::transform()

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.

ChoiceToBooleanArrayTransformer deprecated::reverseTransform()

mixed reverseTransform(array $values) Transforms a checkbox/radio button array to a single choice. The input value is an array with the choices as keys and true/false as values, depending on whether a given choice is selected. The output is the selected choice. Parameters array $values An array of values Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not an array, if the recuperation of the choices fail

ChoicesToBooleanArrayTransformer deprecated

class ChoicesToBooleanArrayTransformer implements DataTransformerInterface deprecated since version 2.7, to be removed in 3.0. Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead. Methods __construct(ChoiceListInterface $choiceList) mixed transform(mixed $array) Transforms an array of choices to a format appropriate for the nested checkboxes/radio buttons. mixed reverseTransform(mixed $values) Transforms a checkbox/radio button array to an array of choices.

ChoiceQuestion::setPrompt()

ChoiceQuestion setPrompt(string $prompt) Sets the prompt for choices. Parameters string $prompt Return Value ChoiceQuestion The current instance

ChoicesToBooleanArrayTransformer deprecated::transform()

mixed transform(mixed $array) Transforms an array of choices to a format appropriate for the nested checkboxes/radio buttons. The result is an array with the options as keys and true/false as values, depending on whether a given option is selected. If this field is rendered as select tag, the value is not modified. Parameters mixed $array An array Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not an