You are here

public function MediaLibraryWidget::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php \Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget::__construct()

Constructs a MediaLibraryWidget widget.

Parameters

string $plugin_id: The plugin_id for the plugin instance.

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\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager service.

\Drupal\Core\Session\AccountInterface $current_user: The current active user.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

Overrides WidgetBase::__construct

File

core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php, line 88

Class

MediaLibraryWidget
Plugin implementation of the 'media_library_widget' widget.

Namespace

Drupal\media_library\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeManagerInterface $entity_type_manager, AccountInterface $current_user, ModuleHandlerInterface $module_handler) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->entityTypeManager = $entity_type_manager;
  $this->currentUser = $current_user;
  $this->moduleHandler = $module_handler;
}