Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList::addChoices
Recursively adds the given choices to the list.
Signature
protected function addChoices(array&
$bucketForPreferred,
array&
$bucketForRemaining,
Traversable
$choices,
array
$labels,
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.
$choices
—
object
- The list of choices.
$labels
—
array
- The labels corresponding to the choices.
$preferredChoices
—
array
- The preferred choices.
Errors/Exceptions
-
InvalidArgumentException
- If the structures of the choices and labels array do not match.
-
InvalidConfigurationException
- If no valid value or index could be created for a choice.