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

string[] getValues() Returns the values for the choices. The values are strings that do not contain duplicates. Return Value string[] The choice values

ChoiceLoaderInterface

interface ChoiceLoaderInterface Loads a choice list. The methods {@link loadChoicesForValues()} and {@link loadValuesForChoices()} can be used to load the list only partially in cases where a fully-loaded list is not necessary. Methods ChoiceListInterface loadChoiceList(null|callable $value = null) Loads a list of choices. array loadChoicesForValues(array $values, null|callable $value = null) Loads the choices corresponding to the given values. string[] loadValuesForChoices(arr

ChoiceListInterface deprecated::getIndicesForValues()

array getIndicesForValues(array $values) deprecated deprecated since version 2.4, to be removed in 3.0. Returns the indices corresponding to the given values. The indices must be positive integers or strings accepted by {@link \Symfony\Component\Form\FormConfigBuilder::validateName()}. The index "placeholder" is internally reserved. The indices must be returned with the same keys and in the same order as the corresponding values in the given array. Parameters array $values A

ChoiceListInterface deprecated::getValues()

array getValues() Returns the values for the choices. Return Value array The values with the corresponding choice indices as keys

ChoiceListInterface::getChoicesForValues()

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

ChoiceListInterface deprecated::getValuesForChoices()

array getValuesForChoices(array $choices) Returns the values corresponding to the given choices. The values must be strings. The values must be 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. Not existing choices in this array are ignored Return Value array An array of choice values with ascending, 0-based numeric keys

ChoiceListInterface deprecated::getRemainingViews()

array getRemainingViews() Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys. Example: array( 'Group 1' => array( 10 => ChoiceView object, 20 => ChoiceView object, ), 'Group 2' => array( 30 => ChoiceView object, ), ) Return Value array A nested array containing the views with the corresponding choice indices as keys on the lowest levels and the choice group names in the keys of the higher leve

ChoiceListInterface::getChoices()

array getChoices() Returns all selectable choices. Return Value array The selectable choices indexed by the corresponding values

ChoiceListInterface deprecated::getPreferredViews()

array getPreferredViews() Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys. Example: array( 'Group 1' => array( 10 => ChoiceView object, 20 => ChoiceView object, ), 'Group 2' => array( 30 => ChoiceView object, ), ) Return Value array A nested array containing the views with the corresponding choice indices as keys on the lowest levels and the choice group names in the keys of the higher levels