You are here

public static function DoubleField::isListAllowed in Double Field 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldType/DoubleField.php \Drupal\double_field\Plugin\Field\FieldType\DoubleField::isListAllowed()

Checks if list option is allowed for a given sub-field type.

2 calls to DoubleField::isListAllowed()
DoubleField::fieldSettingsForm in src/Plugin/Field/FieldType/DoubleField.php
Returns a form for the field-level settings.
DoubleField::getConstraints in src/Plugin/Field/FieldType/DoubleField.php
@todo Find a way to disable constraints for default field values.

File

src/Plugin/Field/FieldType/DoubleField.php, line 628

Class

DoubleField
Plugin implementation of the 'double_field' field type.

Namespace

Drupal\double_field\Plugin\Field\FieldType

Code

public static function isListAllowed(string $subfield_type) : bool {
  $list_types = [
    'string',
    'integer',
    'float',
    'numeric',
    'email',
    'telephone',
    'uri',
    'datetime_iso8601',
  ];
  return in_array($subfield_type, $list_types);
}