You are here

public function ModerationStateConstraintValidator::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php \Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator::__construct()
  2. 9 core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php \Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator::__construct()

Creates a new ModerationStateConstraintValidator instance.

Parameters

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

\Drupal\content_moderation\ModerationInformationInterface $moderation_information: The moderation information.

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

\Drupal\content_moderation\StateTransitionValidationInterface $state_transition_validation: The state transition validation service.

File

core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php, line 60

Class

ModerationStateConstraintValidator
Checks if a moderation state transition is valid.

Namespace

Drupal\content_moderation\Plugin\Validation\Constraint

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ModerationInformationInterface $moderation_information, AccountInterface $current_user, StateTransitionValidationInterface $state_transition_validation) {
  $this->entityTypeManager = $entity_type_manager;
  $this->moderationInformation = $moderation_information;
  $this->currentUser = $current_user;
  $this->stateTransitionValidation = $state_transition_validation;
}