Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList::addChoice
Adds a new choice.
Signature
protected function addChoice(array&
$bucketForPreferred,
array&
$bucketForRemaining,
mixed
$choice,
string
$label,
array
$preferredChoices )
Parameters
$bucketForPreferred
—
array
- The bucket where to store the preferred
view objects.
$bucketForRemaining
—
array
- The bucket where to store the
non-preferred view objects.
$choice
—
mixed
- The choice to add.
$label
—
string
- The label for the choice.
$preferredChoices
—
array
- The preferred choices.
Errors/Exceptions
-
InvalidConfigurationException
- If no valid value or index could be created.