public static function ScheduledPublish::propertyDefinitions in Scheduled Publish 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/Field/FieldType/ScheduledPublish.php \Drupal\scheduled_publish\Plugin\Field\FieldType\ScheduledPublish::propertyDefinitions()
- 8 src/Plugin/Field/FieldType/ScheduledPublish.php \Drupal\scheduled_publish\Plugin\Field\FieldType\ScheduledPublish::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
- src/
Plugin/ Field/ FieldType/ ScheduledPublish.php, line 41
Class
- ScheduledPublish
- Plugin implementation of the 'scheduled_publish_type' field type.
Namespace
Drupal\scheduled_publish\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');
$properties['moderation_state'] = DataDefinition::create('string')
->setLabel(t('The moderation state.'));
return $properties;
}