DoctrineChoiceLoader
extends AbstractChoiceLoader
in package
Loads choices using a Doctrine object manager.
Tags
Table of Contents
Properties
- $choices : iterable<string|int, mixed>|null
- $class : string
- $idReader : mixed
- $manager : mixed
- $objectLoader : mixed
Methods
- __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.
- doLoadChoicesForValues() : array<string|int, mixed>
- doLoadValuesForChoices() : array<string|int, mixed>
- loadChoices() : iterable<string|int, mixed>
Properties
$choices
private
iterable<string|int, mixed>|null
$choices
$class
private
string
$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
loadChoiceList()
Loads a list of choices.
public
loadChoiceList([callable $value = null ]) : ChoiceListInterface
Parameters
- $value : callable = null
-
The callable which generates the values from choices
Tags
Return values
ChoiceListInterfaceloadChoicesForValues()
Loads the choices corresponding to the given values.
public
loadChoicesForValues(array<string|int, mixed> $values[, callable $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 : callable = null
-
The callable generating the choice values
Return values
array<string|int, mixed>loadValuesForChoices()
Loads the values corresponding to the given choices.
public
loadValuesForChoices(array<string|int, mixed> $choices[, callable $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 : callable = null
-
The callable generating the choice values
Return values
array<string|int, string>doLoadChoicesForValues()
protected
doLoadChoicesForValues(array<string|int, mixed> $values, callable|null $value) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
- $value : callable|null
Return values
array<string|int, mixed>doLoadValuesForChoices()
protected
doLoadValuesForChoices(array<string|int, mixed> $choices) : array<string|int, mixed>
Parameters
- $choices : array<string|int, mixed>
Return values
array<string|int, mixed>loadChoices()
protected
loadChoices() : iterable<string|int, mixed>