function OptionsWidgetBase::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php \Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase::__construct()
  2. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php \Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase::__construct()
  3. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php \Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase::__construct()

Overrides WidgetBase::__construct

1 call to OptionsWidgetBase::__construct()
ModerationStateWidget::__construct in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
Constructs a new ModerationStateWidget object.
1 method overrides OptionsWidgetBase::__construct()
ModerationStateWidget::__construct in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
Constructs a new ModerationStateWidget object.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php, line 59

Class

OptionsWidgetBase
Base class for the 'options_*' widgets.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
    $property_names = $this->fieldDefinition
        ->getFieldStorageDefinition()
        ->getPropertyNames();
    $this->column = $property_names[0];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.