function ListItemBase::castAllowedValue
Same name in other branches
- 9 core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::castAllowedValue()
- 10 core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::castAllowedValue()
- 11.x core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::castAllowedValue()
Converts a value to the correct type.
Parameters
mixed $value: The value to cast.
Return value
mixed The casted value.
1 call to ListItemBase::castAllowedValue()
- ListItemBase::structureAllowedValues in core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListItemBase.php - Creates a structured array of allowed values from a key-value array.
3 methods override ListItemBase::castAllowedValue()
- ListFloatItem::castAllowedValue in core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListFloatItem.php - Converts a value to the correct type.
- ListIntegerItem::castAllowedValue in core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListIntegerItem.php - Converts a value to the correct type.
- ListStringItem::castAllowedValue in core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListStringItem.php - Converts a value to the correct type.
File
-
core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListItemBase.php, line 330
Class
- ListItemBase
- Plugin base class inherited by the options field types.
Namespace
Drupal\options\Plugin\Field\FieldTypeCode
protected static function castAllowedValue($value) {
return $value;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.