You are here

public static function WebformEntityReferenceItem::propertyDefinitions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/Field/FieldType/WebformEntityReferenceItem.php \Drupal\webform\Plugin\Field\FieldType\WebformEntityReferenceItem::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 EntityReferenceItem::propertyDefinitions

See also

\Drupal\Core\Field\BaseFieldDefinition

File

src/Plugin/Field/FieldType/WebformEntityReferenceItem.php, line 78

Class

WebformEntityReferenceItem
Defines the 'webform_entity_reference' entity field type.

Namespace

Drupal\webform\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);
  $properties['default_data'] = DataDefinition::create('string')
    ->setLabel(t('Default submission data'));
  $properties['status'] = DataDefinition::create('string')
    ->setLabel(t('Status'))
    ->setDescription(t('Flag to control whether this webform should be open or closed to new submissions.'));
  $properties['open'] = DataDefinition::create('datetime_iso8601')
    ->setLabel(t('Open value'));
  $properties['close'] = DataDefinition::create('datetime_iso8601')
    ->setLabel(t('Close value'));
  return $properties;
}