The implementation of ChoiceList was changed heavily. As a result,
ArrayChoiceList was replaced. If you have custom classes that extend
this class, you must now extend SimpleChoiceList and pass choices
to the parent constructor.
Before:
class MyChoiceList extends ArrayChoiceList
{
protected function load()
{
parent::load();
// load choices
$this->choices = $choices;
}
}
After:
class MyChoiceList extends SimpleChoiceList
{
public function __construct()
{
// load choices
parent::__construct($choices);
}
}
If you need to load the choices lazily -- that is, as soon as they are
accessed for the first time -- you can extend LazyChoiceList instead
and load the choices by overriding loadChoiceList().
class MyChoiceList extends LazyChoiceList
{
protected function loadChoiceList()
{
// load choices
return new SimpleChoiceList($choices);
}
}
PaddedChoiceList, MonthChoiceList and TimezoneChoiceList were removed.
Their functionality was merged into DateType, TimeType and TimezoneType.
EntityChoiceList was adapted. The methods getEntities(),
getEntitiesByKeys(), getIdentifier() and getIdentifierValues() were
removed or made private. Instead of the first two, you can now use
getChoices() and getChoicesByValues(). For the latter two, no
replacement exists.
The implementation of
ChoiceList
was changed heavily. As a result,ArrayChoiceList
was replaced. If you have custom classes that extend this class, you must now extendSimpleChoiceList
and pass choices to the parent constructor.Before:
After:
If you need to load the choices lazily -- that is, as soon as they are accessed for the first time -- you can extend
LazyChoiceList
instead and load the choices by overridingloadChoiceList()
.PaddedChoiceList
,MonthChoiceList
andTimezoneChoiceList
were removed. Their functionality was merged intoDateType
,TimeType
andTimezoneType
.EntityChoiceList
was adapted. The methodsgetEntities()
,getEntitiesByKeys()
,getIdentifier()
andgetIdentifierValues()
were removed or made private. Instead of the first two, you can now usegetChoices()
andgetChoicesByValues()
. For the latter two, no replacement exists.