public static function IdTagItem::propertyDefinitions in farmOS 2.x
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
- modules/
core/ id_tag/ src/ Plugin/ Field/ FieldType/ IdTagItem.php, line 54
Class
- IdTagItem
- Plugin implementation of the 'ID tag' field type.
Namespace
Drupal\farm_id_tag\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['id'] = DataDefinition::create('string')
->setLabel(t('ID of the tag'));
$properties['type'] = DataDefinition::create('string')
->setLabel(t('Type of the tag'));
$properties['location'] = DataDefinition::create('string')
->setLabel(t('Location of the tag'));
return $properties;
}