DoctrineChoiceLoader
in package
implements
ChoiceLoaderInterface
Loads choices using a Doctrine object manager.
Tags
Interfaces, Classes, Traits and Enums
- ChoiceLoaderInterface
- Loads a choice list.
Table of Contents
- $choiceList : ChoiceListInterface
- $class : mixed
- $idReader : mixed
- $manager : mixed
- $objectLoader : mixed
- __construct() : mixed
- Creates a new choice loader.
- loadChoiceList() : ChoiceListInterface
- Loads a list of choices.
- loadChoicesForValues() : array<string|int, mixed>
- Loads the choices corresponding to the given values.
- loadValuesForChoices() : array<string|int, string>
- Loads the values corresponding to the given choices.
Properties
$choiceList
private
ChoiceListInterface
$choiceList
$class
private
mixed
$class
$idReader
private
mixed
$idReader
$manager
private
mixed
$manager
$objectLoader
private
mixed
$objectLoader
Methods
__construct()
Creates a new choice loader.
public
__construct(ObjectManager $manager, string $class[, IdReader $idReader = null ][, EntityLoaderInterface $objectLoader = null ]) : mixed
Optionally, an implementation of can be passed which optimizes the object loading for one of the Doctrine mapper implementations.
Parameters
- $manager : ObjectManager
- $class : string
-
The class name of the loaded objects
- $idReader : IdReader = null
- $objectLoader : EntityLoaderInterface = null
Return values
mixed —loadChoiceList()
Loads a list of choices.
public
loadChoiceList([mixed $value = null ]) : ChoiceListInterface
Parameters
- $value : mixed = null
-
The callable which generates the values from choices
Return values
ChoiceListInterface —The loaded choice list
loadChoicesForValues()
Loads the choices corresponding to the given values.
public
loadChoicesForValues(array<string|int, mixed> $values[, mixed $value = null ]) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
-
An array of choice values. Non-existing values in this array are ignored
- $value : mixed = null
-
The callable generating the choice values
Return values
array<string|int, mixed> —An array of choices
loadValuesForChoices()
Loads the values corresponding to the given choices.
public
loadValuesForChoices(array<string|int, mixed> $choices[, mixed $value = null ]) : array<string|int, string>
Parameters
- $choices : array<string|int, mixed>
-
An array of choices. Non-existing choices in this array are ignored
- $value : mixed = null
-
The callable generating the choice values
Return values
array<string|int, string> —An array of choice values