You are here

protected static function ListItemBase::castAllowedValue in Drupal 9

Same name and namespace in other branches
  1. 8 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 327

Class

ListItemBase
Plugin base class inherited by the options field types.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

protected static function castAllowedValue($value) {
  return $value;
}