You are here

public function NotificationInformation::getWorkflow in Content Moderation Notifications 8.2

Same name and namespace in other branches
  1. 8.3 src/NotificationInformation.php \Drupal\content_moderation_notifications\NotificationInformation::getWorkflow()

Checks for the workflow object of the moderated entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity we may be moderating.

Return value

mixed The workflow object if the entity is moderated, FALSE otherwise.

Overrides NotificationInformationInterface::getWorkflow

2 calls to NotificationInformation::getWorkflow()
NotificationInformation::getNotifications in src/NotificationInformation.php
Gets the list of notification based on the current transition.
NotificationInformation::getTransition in src/NotificationInformation.php
Checks for the current transition of the moderated entity.

File

src/NotificationInformation.php, line 51

Class

NotificationInformation
Service for notification related questions about the moderated entity.

Namespace

Drupal\content_moderation_notifications

Code

public function getWorkflow(EntityInterface $entity) {
  return $this
    ->isModeratedEntity($entity) ? $this->moderationInformation
    ->getWorkflowForEntity($entity) : FALSE;
}