You are here

public static function PublicationDateItem::propertyDefinitions in Publication Date 8

Same name and namespace in other branches
  1. 8.2 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 48
Contains \Drupal\publication_date\Plugin\Field\FieldType\PublicationDateItem.

Class

PublicationDateItem
Defines the 'published_at' entity field type.

Namespace

Drupal\publication_date\Plugin\Field\FieldType

Code

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);
  return $properties;
}