Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList::initialize
Initializes the list with choices.
Safe to be called multiple times. The list is cleared on every call.
Signature
protected function initialize(Traversable
$choices,
array
$labels,
array
$preferredChoices )
Parameters
$choices
— object- The choices to write into the list.
$labels
— array- Ignored.
$preferredChoices
— array- The choices to display with priority.
Errors/Exceptions
-
InvalidArgumentException
- When passing a hierarchy of choices and using