function ListIntegerItem::validateAllowedValue
Same name in other branches
- 9 core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php \Drupal\options\Plugin\Field\FieldType\ListIntegerItem::validateAllowedValue()
- 8.9.x core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php \Drupal\options\Plugin\Field\FieldType\ListIntegerItem::validateAllowedValue()
- 11.x core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php \Drupal\options\Plugin\Field\FieldType\ListIntegerItem::validateAllowedValue()
Overrides ListItemBase::validateAllowedValue
File
-
core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListIntegerItem.php, line 69
Class
- ListIntegerItem
- Plugin implementation of the 'list_integer' field type.
Namespace
Drupal\options\Plugin\Field\FieldTypeCode
protected static function validateAllowedValue($option) {
if (!preg_match('/^-?\\d+$/', $option)) {
return new TranslatableMarkup('Allowed values list: keys must be integers.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.