$notification, 'document' => $doc = $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($notification->getRelatedEntityId()), 'evaluation' => $doc?->getAccompanyingPeriodWorkEvaluation(), ]; } public function supports(Notification $notification, array $options = []): bool { return AccompanyingPeriodWorkEvaluationDocument::class === $notification->getRelatedEntityClass(); } public function getTitle(Notification $notification, array $options = []): TranslatableInterface { if (null === $eval = $this->getRelatedEntity($notification)) { return new TranslatableMessage('evaluation.deleted'); } return new TranslatableMessage( 'accompanying_course_evaluation_document.title', [ 'id' => $eval->getId(), 'doc_title' => $eval->getTitle(), ] ); } public function getAssociatedPersons(Notification $notification, array $options = []): array { if (null === $eval = $this->getRelatedEntity($notification)) { return []; } return $eval->getAccompanyingPeriodWorkEvaluation()->getAccompanyingPeriodWork()->getPersons()->getValues(); } public function getRelatedEntity(Notification $notification): ?AccompanyingPeriodWorkEvaluationDocument { return $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($notification->getRelatedEntityId()); } }