ModelChoiceList
class ModelChoiceList extends ObjectChoiceList
A choice list for object choices based on Propel model.
Methods
Constructor.
Returns the list of choices
Returns the values for the choices
Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.
Returns the choices corresponding to the given values.
Returns the values corresponding to the given choices.
Returns the indices corresponding to the given choices.
Returns the indices corresponding to the given values.
Returns the class name of the model.
Details
at line line 87
__construct(string $class, string $labelPath = null, array|Traversable $choices = null, ModelCriteria $queryObject = null, string $groupPath = null, array|ModelCriteria $preferred = array(), PropertyAccessorInterface $propertyAccessor = null, string $useAsIdentifier = null)
Constructor.
at line line 141
array
getChoices()
Returns the list of choices
at line line 151
array
getValues()
Returns the values for the choices
at line line 161
array
getPreferredViews()
Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
Example:
at line line 171
array
getRemainingViews()
Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.
Example:
at line line 181
array
getChoicesForValues(array $values)
Returns the choices corresponding to the given values.
The choices can have any data type.
The choices must be returned with the same keys and in the same order as the corresponding values in the given array.
at line line 235
array
getValuesForChoices(array $models)
Returns the values corresponding to the given choices.
The values must be strings.
The values must be returned with the same keys and in the same order as the corresponding choices in the given array.
at line line 305
array
getIndicesForChoices(array $models)
deprecated
deprecated
Returns the indices corresponding to the given choices.
The indices must be positive integers or strings accepted by {@link FormConfigBuilder::validateName()}.
The index "placeholder" is internally reserved.
The indices must be returned with the same keys and in the same order as the corresponding choices in the given array.
at line line 351
array
getIndicesForValues(array $values)
deprecated
deprecated
Returns the indices corresponding to the given values.
The indices must be positive integers or strings accepted by {@link FormConfigBuilder::validateName()}.
The index "placeholder" is internally reserved.
The indices must be returned with the same keys and in the same order as the corresponding values in the given array.
at line line 133
string
getClass()
Returns the class name of the model.