class ModelChoiceList extends ObjectChoiceList
A choice list for object choices based on Propel model.
Methods
__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. | ||
array | getChoices() Returns the list of choices | |
array | getValues() Returns the values for the choices | |
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 choices corresponding to the given values. | |
array | getValuesForChoices(array $models) Returns the values corresponding to the given choices. | |
array | getIndicesForChoices(array $models) deprecated Returns the indices corresponding to the given choices. | |
array | getIndicesForValues(array $values) deprecated Returns the indices corresponding to the given values. | |
string | getClass() Returns the class name of the model. |
Details
__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.
array getChoices()
Returns the list of choices
array getValues()
Returns the values for the choices
array getPreferredViews()
Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
Example:
array( 'Group 1' => array( 10 => ChoiceView object, 20 => ChoiceView object, ), 'Group 2' => array( 30 => ChoiceView object, ), )
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:
array( 'Group 1' => array( 10 => ChoiceView object, 20 => ChoiceView object, ), 'Group 2' => array( 30 => ChoiceView object, ), )
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.
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.
array getIndicesForChoices(array $models) deprecated
deprecated
Deprecated since version 2.4, to be removed in 3.0.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.
array getIndicesForValues(array $values) deprecated
deprecated
Deprecated since version 2.4, to be removed in 3.0.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.
string getClass()
Returns the class name of the model.
Please login to continue.