Form\ChoiceList\EntityChoiceList (Bridge\Doctrine)
Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList
class EntityChoiceList extends ObjectChoiceList
A choice list presenting a list of Doctrine entities as choices.
Methods
__construct(ObjectManager $manager, string $class, string $labelPath = null, EntityLoaderInterface $entityLoader = null, array|Traversable|null $entities = null, array $preferredEntities = array(), string $groupPath = null, PropertyAccessorInterface $propertyAccessor = null) Creates a new entity choice list. | ||
array | getChoices() Returns the list of entities. | |
array | getValues() Returns the values for the entities. | |
array | getPreferredViews() Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys. | |
array | getRemainingViews() Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys. | |
array | getChoicesForValues(array $values) Returns the entities corresponding to the given values. | |
array | getValuesForChoices(array $entities) Returns the values corresponding to the given entities. | |
array | getIndicesForChoices(array $entities) Returns the indices corresponding to the given entities. | |
array | getIndicesForValues(array $values) Returns the entities corresponding to the given values. |
Details
public __construct(ObjectManager $manager, string $class, string $labelPath = null, EntityLoaderInterface $entityLoader = null, array|Traversable|null $entities = null, array $preferredEntities = array(), string $groupPath = null, PropertyAccessorInterface $propertyAccessor = null)
Creates a new entity choice list.
public array getChoices()
Returns the list of entities.
public array getValues()
Returns the values for the entities.
public array getPreferredViews()
Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
public array getRemainingViews()
Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.
public array getChoicesForValues(array $values)
Returns the entities corresponding to the given values.
public array getValuesForChoices(array $entities)
Returns the values corresponding to the given entities.
public array getIndicesForChoices(array $entities)
Returns the indices corresponding to the given entities.
public array getIndicesForValues(array $values)
Returns the entities corresponding to the given values.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.html