3 namespace Drupal\entity_test\Plugin\Field\FieldType;
5 use Drupal\Core\Field\FieldStorageDefinitionInterface;
8 * Defines the 'shape_required' field type.
11 * id = "shape_required",
12 * label = @Translation("Shape (required)"),
13 * description = @Translation("Yet another dummy field type."),
16 class ShapeItemRequired extends ShapeItem {
21 public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
22 $properties = parent::propertyDefinitions($field_definition);
23 $properties['shape']->setRequired(TRUE);