class ModelChoiceList extends ObjectChoiceList
Widely inspired by the EntityChoiceList.
Methods
|
__construct(string $class, string $labelPath = null, array $choices = null, ModelCriteria $queryObject = null, string $groupPath = null, array|ModelCriteria $preferred = array(), PropertyAccessorInterface $propertyAccessor = null)
Creates a new choice list. |
||
| string |
getClass()
Returns the class name |
|
| array |
getChoices()
Returns the list of model objects |
|
| array |
getValues()
Returns the values for the model objects |
|
| 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 model objects corresponding to the given values. |
|
| array |
getValuesForChoices(array $models)
Returns the values corresponding to the given model objects. |
|
| array |
getIndicesForChoices(array $models)
Returns the indices corresponding to the given models. |
|
| array |
getIndicesForValues(array $values)
Returns the models corresponding to the given values. |
Details
at line 82
public
__construct(string $class, string $labelPath = null, array $choices = null, ModelCriteria $queryObject = null, string $groupPath = null, array|ModelCriteria $preferred = array(), PropertyAccessorInterface $propertyAccessor = null)
Creates a new choice list.
at line 116
public string
getClass()
Returns the class name
at line 128
public array
getChoices()
Returns the list of model objects
at line 144
public array
getValues()
Returns the values for the model objects
at line 161
public array
getPreferredViews()
Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
at line 178
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.
at line 196
public array
getChoicesForValues(array $values)
Returns the model objects corresponding to the given values.
at line 222
public array
getValuesForChoices(array $models)
Returns the values corresponding to the given model objects.
at line 256
public array
getIndicesForChoices(array $models)
Returns the indices corresponding to the given models.
at line 291
public array
getIndicesForValues(array $values)
Returns the models corresponding to the given values.