function ListItemBase::validateAllowedValue

Same name in other branches
  1. 9 core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::validateAllowedValue()
  2. 8.9.x core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::validateAllowedValue()
  3. 10 core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::validateAllowedValue()

Checks whether a candidate allowed value is valid.

Parameters

string $option: The option value entered by the user.

Return value

string The error message if the specified value is invalid, NULL otherwise.

2 calls to ListItemBase::validateAllowedValue()
ListItemBase::extractAllowedValues in core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
Extracts the allowed values array from the allowed_values element.
ListItemBase::validateAllowedValues in core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
#element_validate callback for options field allowed values.
3 methods override ListItemBase::validateAllowedValue()
ListFloatItem::validateAllowedValue in core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php
Checks whether a candidate allowed value is valid.
ListIntegerItem::validateAllowedValue in core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php
Checks whether a candidate allowed value is valid.
ListStringItem::validateAllowedValue in core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php
Checks whether a candidate allowed value is valid.

File

core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php, line 450

Class

ListItemBase
Plugin base class inherited by the options field types.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

protected static function validateAllowedValue($option) {
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.