You are here

public function ModerationStateWidget::__construct in Workbench Moderation 8

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

Constructs a new ModerationStateWidget object.

Parameters

string $plugin_id: Plugin id.

mixed $plugin_definition: Plugin definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: Field definition.

array $settings: Field settings.

array $third_party_settings: Third party settings.

\Drupal\Core\Session\AccountInterface $current_user: Current user service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager.

\Drupal\Core\Entity\EntityStorageInterface $moderation_state_storage: Moderation state storage.

\Drupal\Core\Entity\EntityStorageInterface $moderation_state_transition_storage: Moderation state transition storage.

\Drupal\workbench_moderation\ModerationInformation $moderation_information: Moderation information.

\Drupal\workbench_moderation\StateTransitionValidation $validator: State transition validator.

Overrides OptionsWidgetBase::__construct

File

src/Plugin/Field/FieldWidget/ModerationStateWidget.php, line 107

Class

ModerationStateWidget
Plugin implementation of the 'moderation_state_default' widget.

Namespace

Drupal\workbench_moderation\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, EntityStorageInterface $moderation_state_storage, EntityStorageInterface $moderation_state_transition_storage, ModerationInformation $moderation_information, StateTransitionValidation $validator) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->moderationStateTransitionEntityQuery = $entity_type_manager
    ->getStorage('moderation_state_transition')
    ->getQuery();
  $this->moderationStateTransitionStorage = $moderation_state_transition_storage;
  $this->moderationStateStorage = $moderation_state_storage;
  $this->entityTypeManager = $entity_type_manager;
  $this->currentUser = $current_user;
  $this->moderationInformation = $moderation_information;
  $this->validator = $validator;
}