You are here

public function Notification::processEntity in Content Moderation Notifications 8.3

Processes a given entity in transition.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being transitioned from one state to another.

Overrides NotificationInterface::processEntity

File

src/Notification.php, line 89

Class

Notification
General service for moderation-related questions about Entity API.

Namespace

Drupal\content_moderation_notifications

Code

public function processEntity(EntityInterface $entity) {
  $notifications = $this->notificationInformation
    ->getNotifications($entity);
  if (!empty($notifications)) {
    $this
      ->sendNotification($entity, $notifications);
  }
}