public static function ViewsReferenceItem::propertyDefinitions in Views Reference Field 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldType/ViewsReferenceItem.php \Drupal\viewsreference\Plugin\Field\FieldType\ViewsReferenceItem::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 EntityReferenceItem::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
Plugin/ Field/ FieldType/ ViewsReferenceItem.php, line 53
Class
- ViewsReferenceItem
- Defines the 'viewsreference' entity field type.
Namespace
Drupal\viewsreference\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['display_id'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Display Id'))
->setDescription(new TranslatableMarkup('The referenced display Id'));
$properties['data'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Data'))
->setDescription(new TranslatableMarkup('Settings data for advanced use'));
return $properties;
}