public function getClass() { // Derive list class from the field type.
$type_definition = \Drupal::
service('plugin.manager.field.field_type'
) ->
getDefinition($this->
getType());
return $type_definition['list_class'
];
} /**
* {@inheritdoc}
*/
public function getConstraints() { return \Drupal::
typedDataManager()->
getDefaultConstraints($this) +
$this->constraints;
} /**
* {@inheritdoc}
*/
public function getConstraint($constraint_name) { $constraints =
$this->
getConstraints();
return $constraints[$constraint_name] ?? NULL;
} /**
* {@inheritdoc}
*/