Symfony\Bridge\Propel1\Form\ChoiceList\ModelChoiceList
Widely inspired by the EntityChoiceList.
- Author: William Durand <william.durand1@gmail.com>
Synopsis
class ModelChoiceList
extends ObjectChoiceList
{
- // members
- protected array $identifier;
- protected ModelCriteria $query;
- protected ModelCriteria $preferredQuery;
- protected Boolean $loaded;
- private Boolean $identifierAsIndex;
- // methods
- public void __construct()
- public string getClass()
- public array getChoices()
- public array getValues()
- public array getPreferredViews()
- public array getRemainingViews()
- public array getChoicesForValues()
- public array getValuesForChoices()
- public array getIndicesForChoices()
- public array getIndicesForValues()
- protected integer|string createIndex()
- protected integer|string createValue()
- private void load()
- private array getIdentifierValues()
- private Boolean isInteger()
- // Inherited methods from ObjectChoiceList
- public void __construct()
- protected void initialize()
- protected integer|string createValue()
- // Inherited methods from ChoiceList
- public void __construct()
- protected void initialize()
- public void getChoices()
- public void getValues()
- public void getPreferredViews()
- public void getRemainingViews()
- public void getChoicesForValues()
- public void getValuesForChoices()
- public void getIndicesForChoices()
- public void getIndicesForValues()
- protected void addChoices()
- protected void addChoiceGroup()
- protected void addChoice()
- protected Boolean isPreferred()
- protected integer|string createIndex()
- protected string createValue()
- protected string fixValue()
- protected array fixValues()
- protected integer|string fixIndex()
- protected array fixIndices()
- protected mixed fixChoice()
- protected array fixChoices()
Hierarchy
Members
private
- $identifierAsIndex
—
Symfony\Bridge\Propel1\Form\ChoiceList\Boolean
Whether to use the identifier for index generation
protected
- $identifier
—
array
The fields of which the identifier of the underlying class consists - $loaded
—
Symfony\Bridge\Propel1\Form\ChoiceList\Boolean
Whether the model objects have already been loaded. - $preferredQuery
—
ModelCriteria
The query to retrieve the preferred choices for this list. - $query
—
ModelCriteria
The query to retrieve the choices of this list.
Methods
private
- getIdentifierValues() — Returns the values of the identifier fields of an model
- isInteger() — Whether this column in an integer
- load() — Loads the list with model objects.
protected
- createIndex() — Creates a new unique index for this model.
- createValue() — Creates a new unique value for this model.
public
- __construct() — Constructor.
- getChoices() — Returns the list of model objects
- getChoicesForValues() — Returns the model objects corresponding to the given values.
- getClass() — Returns the class name
- getIndicesForChoices() — Returns the indices corresponding to the given models.
- getIndicesForValues() — Returns the models corresponding to the given values.
- getPreferredViews() — Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.
- getRemainingViews() — Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.
- getValues() — Returns the values for the model objects
- getValuesForChoices() — Returns the values corresponding to the given model objects.
Inherited from Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList
protected
- createValue() — Creates a new unique value for this choice.
- initialize() — Initializes the list with choices.
Inherited from Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList
protected
- addChoice() — Adds a new choice.
- addChoiceGroup() — Recursively adds a choice group.
- addChoices() — Recursively adds the given choices to the list.
- createIndex() — Creates a new unique index for this choice.
- createValue() — Creates a new unique value for this choice.
- fixChoice() — Fixes the data type of the given choice to avoid comparison problems.
- fixChoices() — Fixes the data type of the given choices to avoid comparison problems.
- fixIndex() — Fixes the data type of the given choice index to avoid comparison problems.
- fixIndices() — Fixes the data types of the given choice indices to avoid comparison problems.
- fixValue() — Fixes the data type of the given choice value to avoid comparison problems.
- fixValues() — Fixes the data types of the given choice values to avoid comparison problems.
- initialize() — Initializes the list with choices.
- isPreferred() — Returns whether the given choice should be preferred judging by the given array of preferred choices.
public
- getChoices() — {@inheritdoc}
- getChoicesForValues() — {@inheritdoc}
- getIndicesForChoices() — {@inheritdoc}
- getIndicesForValues() — {@inheritdoc}
- getPreferredViews() — {@inheritdoc}
- getRemainingViews() — {@inheritdoc}
- getValues() — {@inheritdoc}
- getValuesForChoices() — {@inheritdoc}