You are here

protected function ConstraintValidatorBase::getEntityWorkflowType in Scheduler content moderation integration 8

Gets the workflow type from the supplied entity's configured workflow.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity to get the workflow type for.

Return value

\Drupal\workflows\WorkflowTypeInterface The workflow type.

1 call to ConstraintValidatorBase::getEntityWorkflowType()
ConstraintValidatorBase::isValidTransition in src/Plugin/Validation/Constraint/ConstraintValidatorBase.php
Validate transition.

File

src/Plugin/Validation/Constraint/ConstraintValidatorBase.php, line 68

Class

ConstraintValidatorBase
Base class for Scheduler Content Moderation Integration validators.

Namespace

Drupal\scheduler_content_moderation_integration\Plugin\Validation\Constraint

Code

protected function getEntityWorkflowType(ContentEntityInterface $entity) {
  return $this->moderationInformation
    ->getWorkflowForEntity($entity)
    ->getTypePlugin();
}