public static function PublicationDateItem::propertyDefinitions in Publication Date 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldType/PublicationDateItem.php \Drupal\publication_date\Plugin\Field\FieldType\PublicationDateItem::propertyDefinitions()
@inheritDoc
Overrides TimestampItem::propertyDefinitions
File
- src/
Plugin/ Field/ FieldType/ PublicationDateItem.php, line 47 - Contains \Drupal\publication_date\Plugin\Field\FieldType\PublicationDateItem.
Class
- PublicationDateItem
- Defines the 'published_at' entity field type.
Namespace
Drupal\publication_date\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['published_at_or_now'] = DataDefinition::create('timestamp')
->setLabel(t('Published at or now'))
->setComputed(TRUE)
->setClass('\\Drupal\\publication_date\\PublishedAtOrNowComputed')
->setSetting('source', 'value');
return $properties;
}