Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList::__construct
Creates a new entity choice list.
Signature
public function __construct(ObjectManager
$manager,
[EntityLoaderInterface
$class = null,
[EntityLoaderInterface
$labelPath = null,
[EntityLoaderInterface
$entityLoader = null,
[PropertyAccessorInterface
$entities = null,
[PropertyAccessorInterface
$preferredEntities = null,
[PropertyAccessorInterface
$groupPath = null,
[PropertyAccessorInterface
$propertyAccessor = null]]]]]]] )
Parameters
$manager
— Doctrine\Common\Persistence\ObjectManager- An EntityManager instance
$class
— string- The class name
$labelPath
— string- The property path used for the label
$entityLoader
— Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface- An optional query builder
$entities
— array- An array of choices
$preferredEntities
— array- An array of preferred choices
$groupPath
— string- A property path pointing to the property used
to group the choices. Only allowed if
the choices are given as flat array. $propertyAccessor
— Symfony\Component\PropertyAccess\PropertyAccessorInterface- The reflection graph for reading property paths.