class ObjectChoiceList extends ChoiceList
deprecated
since Symfony 2.7, to be removed in version 3.0. Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
A choice list for object choices. Supports generation of choice labels, choice groups and choice values by calling getters of the object (or associated objects).
$choices = array($user1, $user2); // call getName() to determine the choice labels $choiceList = new ObjectChoiceList($choices, 'name');
Methods
__con