function DateTimeItem::propertyDefinitions
Same name in other branches
- 8.9.x core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::propertyDefinitions()
- 10 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::propertyDefinitions()
- 11.x core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::propertyDefinitions()
Overrides FieldItemInterface::propertyDefinitions
1 method overrides DateTimeItem::propertyDefinitions()
- DateRangeItem::propertyDefinitions in core/
modules/ datetime_range/ src/ Plugin/ Field/ FieldType/ DateRangeItem.php - Defines field item properties.
File
-
core/
modules/ datetime/ src/ Plugin/ Field/ FieldType/ DateTimeItem.php, line 49
Class
- DateTimeItem
- Plugin implementation of the 'datetime' field type.
Namespace
Drupal\datetime\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['value'] = DataDefinition::create('datetime_iso8601')->setLabel(new TranslatableMarkup('Date value'))
->setRequired(TRUE);
$properties['date'] = DataDefinition::create('any')->setLabel(new TranslatableMarkup('Computed date'))
->setDescription(new TranslatableMarkup('The computed DateTime object.'))
->setComputed(TRUE)
->setClass('\\Drupal\\datetime\\DateTimeComputed')
->setSetting('date source', 'value');
return $properties;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.