You are here

public static function ScheduledPublish::propertyDefinitions in Scheduled Publish 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldType/ScheduledPublish.php \Drupal\scheduled_publish\Plugin\Field\FieldType\ScheduledPublish::propertyDefinitions()
  2. 8.2 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 DateTimeItem::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\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);
  $properties['moderation_state'] = DataDefinition::create('string')
    ->setLabel(t('The moderation state.'));
  return $properties;
}