class ChoiceToBooleanArrayTransformer implements DataTransformerInterface
Methods
|
__construct(ChoiceListInterface $choiceList, Boolean $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 button array to a single choice. |
Details
at line 33
public
__construct(ChoiceListInterface $choiceList, Boolean $placeholderPresent)
Constructor.
at line 55
public mixed
transform(mixed $choice)
Transforms a single choice 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.
at line 92
public 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.