entityWorkflowRepository->find($notification->getRelatedEntityId()); return [ 'entity_workflow' => $entityWorkflow, 'handler' => null !== $entityWorkflow ? $this->entityWorkflowManager->getHandler($entityWorkflow) : null, 'notificationCc' => $this->isNotificationCc($notification), ]; } private function isNotificationCc(Notification $notification): bool { $notificationCc = false; if (EntityWorkflow::class === $notification->getRelatedEntityClass()) { $relatedEntity = $this->entityWorkflowRepository->findOneBy(['id' => $notification->getRelatedEntityId()]); if (null === $relatedEntity) { return false; } if ($relatedEntity->getCurrentStepCreatedBy() !== $this->security->getUser()) { $notificationCc = true; } } return $notificationCc; } public function supports(Notification $notification, array $options = []): bool { return EntityWorkflow::class === $notification->getRelatedEntityClass(); } }