public static function DateTimeItem::propertyDefinitions in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::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 FieldItemInterface::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- core/
modules/ datetime/ src/ Plugin/ Field/ FieldType/ DateTimeItem.php, line 52 - Contains \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem.
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(t('Date value'))
->setRequired(TRUE);
$properties['date'] = DataDefinition::create('any')
->setLabel(t('Computed date'))
->setDescription(t('The computed DateTime object.'))
->setComputed(TRUE)
->setClass('\\Drupal\\datetime\\DateTimeComputed')
->setSetting('date source', 'value');
return $properties;
}