ChoicesToBooleanArrayTransformer deprecated::reverseTransform()

mixed reverseTransform(mixed $values) Transforms a checkbox/radio button array to an array of choices. 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 an array with the selected choices. Parameters mixed $values An array Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not an array, if the recuperation of the cho

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::isMultiselect()

bool isMultiselect() Returns whether the choices are multiselect. Return Value bool

ChoiceQuestion::setErrorMessage()

ChoiceQuestion setErrorMessage(string $errorMessage) Sets the error message for invalid values. The error message has a string placeholder (%s) for the invalid value. Parameters string $errorMessage Return Value ChoiceQuestion The current instance

ChoiceQuestion::getPrompt()

string getPrompt() Gets the prompt for choices. Return Value string

ChoiceQuestion

class ChoiceQuestion extends Question Represents a choice question. Methods __construct(string $question, array $choices, mixed $default = null) Constructor. string getQuestion() Returns the question. from Question mixed getDefault() Returns the default answer. from Question bool isHidden() Returns whether the user response must be hidden. from Question Question setHidden(bool $hidden) Sets whether the user response must be hidden or not. from Question bool isHiddenF

ChoiceQuestion::getChoices()

array getChoices() Returns available choices. Return Value array

ChoiceListInterface::getOriginalKeys()

int[]|string[] getOriginalKeys() Returns the original keys of the choices. The original keys are the keys of the choice array that was passed in the "choice" option of the choice type. Note that this array may contain duplicates if the "choice" option contained choice groups: $form->add('field', 'choice', array( 'choices' => array( 'Decided' => array(true, false), 'Undecided' => array(null), ), )); In this example, the original key 0 appears t

ChoiceListInterface::getStructuredValues()

string[] getStructuredValues() Returns the values in the structure originally passed to the list. Contrary to {@link getValues()}, the result is indexed by the original keys of the choices. If the original array contained nested arrays, these nested arrays are represented here as well: $form->add('field', 'choice', array( 'choices' => array( 'Decided' => array('Yes' => true, 'No' => false), 'Undecided' => array('Maybe' => null), ), ));

ChoiceListInterface::getValuesForChoices()

string[] getValuesForChoices(array $choices) Returns the values corresponding to the given choices. The values are returned with the same keys and in the same order as the corresponding choices in the given array. Parameters array $choices An array of choices. Non-existing choices in this array are ignored Return Value string[] An array of choice values