You are here

public function TwitterWidgetWidget::__construct in Twitter Profile Widget 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/TwitterWidgetWidget.php \Drupal\twitter_profile_widget\Plugin\Field\FieldWidget\TwitterWidgetWidget::__construct()

Constructs a WidgetBase object.

Parameters

string $plugin_id: The plugin_id for the widget.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the widget is associated.

array $settings: The widget settings.

array $third_party_settings: Any third party settings.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

\Drupal\Core\Config\ConfigFactory $config_factory: The config_factory service.

Overrides WidgetBase::__construct

File

src/Plugin/Field/FieldWidget/TwitterWidgetWidget.php, line 58

Class

TwitterWidgetWidget
Plugin implementation of the 'twitter_widget' widget.

Namespace

Drupal\twitter_profile_widget\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, MessengerInterface $messenger, ConfigFactory $config_factory) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->messenger = $messenger;
  $this->config = $config_factory
    ->get('twitter_profile_widget.settings');
}