public function NotificationInformation::getWorkflow in Content Moderation Notifications 8.3
Same name and namespace in other branches
- 8.2 src/NotificationInformation.php \Drupal\content_moderation_notifications\NotificationInformation::getWorkflow()
Checks for the workflow object of the moderated entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity we may be moderating.
Return value
\Drupal\workflows\WorkflowInterface|bool The workflow object if the entity is moderated, FALSE otherwise.
Overrides NotificationInformationInterface::getWorkflow
3 calls to NotificationInformation::getWorkflow()
- NotificationInformation::getNotifications in src/
NotificationInformation.php - Gets the list of notification based on the current transition.
- NotificationInformation::getPreviousState in src/
NotificationInformation.php - Gets the from/previous state of the entity.
- NotificationInformation::getTransition in src/
NotificationInformation.php - Checks for the current transition of the moderated entity.
File
- src/
NotificationInformation.php, line 71
Class
- NotificationInformation
- Service for notification related questions about the moderated entity.
Namespace
Drupal\content_moderation_notificationsCode
public function getWorkflow(ContentEntityInterface $entity) {
return $this
->isModeratedEntity($entity) ? $this->moderationInformation
->getWorkflowForEntity($entity) : FALSE;
}