function _content_moderation_notifications_check in Content Moderation Notifications 8.2
Triggers the content moderation notification system.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
2 calls to _content_moderation_notifications_check()
File
- ./
content_moderation_notifications.module, line 67 - Hook implementations for the content moderation notifications module.
Code
function _content_moderation_notifications_check(EntityInterface $entity) {
/** @var \Drupal\content_moderation_notifications\NotificationInformationInterface $notification_info */
$notification_info = Drupal::service('content_moderation_notifications.notification_information');
$notifications = $notification_info
->getNotifications($entity);
if (!empty($notifications['notifications'])) {
/** @var \Drupal\content_moderation_notifications\NotificationInterface $notification */
$notification = Drupal::service('content_moderation_notifications.notification');
$notification
->sendNotification($notifications['entity'], $notifications['notifications']);
}
}