# ChoiceListInterface

interface
**ChoiceListInterface**

Contains choices that can be selected in a form field.

Each choice has three different properties:

- Choice: The choice that should be returned to the application by the choice field. Can be any scalar value or an object, but no array.
- Label: A text representing the choice that is displayed to the user.
- Value: A uniquely identifying value that can contain arbitrary characters, but no arrays or objects. This value is displayed in the HTML "value" attribute.

## Methods

Returns the list of choices

Returns the values for the choices

Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.

Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.

Returns the choices corresponding to the given values.

Returns the values corresponding to the given choices.

Returns the indices corresponding to the given choices.

Returns the indices corresponding to the given values.

## Details

###
at line line 36
```
array
```**getChoices**()

**getChoices**()

Returns the list of choices

###
at line line 43
```
array
```**getValues**()

**getValues**()

Returns the values for the choices

###
at line line 67
```
array
```**getPreferredViews**()

**getPreferredViews**()

Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.

Example:

###
at line line 93
```
array
```**getRemainingViews**()

**getRemainingViews**()

Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.

Example:

###
at line line 108
```
array
```**getChoicesForValues**(array $values)

**getChoicesForValues**(array $values)

Returns the choices corresponding to the given values.

The choices can have any data type.

The choices must be returned with the same keys and in the same order as the corresponding values in the given array.

###
at line line 124
```
array
```**getValuesForChoices**(array $choices)

**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.

###
at line line 142
```
array
```**getIndicesForChoices**(array $choices)

**getIndicesForChoices**(array $choices)

Returns the indices corresponding to the given choices.

The indices must be positive integers or strings accepted by {@link 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 choices in the given array.

###
at line line 160
```
array
```**getIndicesForValues**(array $values)

**getIndicesForValues**(array $values)

Returns the indices corresponding to the given values.

The indices must be positive integers or strings accepted by {@link 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.