public static function FieldNote::propertyDefinitions in Examples for Developers 8
Same name and namespace in other branches
- 3.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
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- 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\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['value'] = DataDefinition::create('string')
->setLabel(t('Field Note'));
return $properties;
}