function FieldNote::propertyDefinitions

Same name and namespace in other branches
  1. 8.x-1.x field_permission_example/src/Plugin/Field/FieldType/FieldNote.php \Drupal\field_permission_example\Plugin\Field\FieldType\FieldNote::propertyDefinitions()
  2. 4.0.x modules/field_permission_example/src/Plugin/Field/FieldType/FieldNote.php \Drupal\field_permission_example\Plugin\Field\FieldType\FieldNote::propertyDefinitions()

Defines field item properties.

Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.

Overrides FieldItemInterface::propertyDefinitions

File

modules/field_permission_example/src/Plugin/Field/FieldType/FieldNote.php, line 49

Class

FieldNote
Plugin implementation of the 'field_permission_example' field type.

Namespace

Drupal\field_permission_example\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties['value'] = DataDefinition::create('string')->setLabel(t('Field Note'));
    return $properties;
}