accompanyingPeriodRepository = $accompanyingPeriodRepository; } public function getTemplate(Notification $notification, array $options = []): string { return '@ChillPerson/AccompanyingPeriod/showInNotification.html.twig'; } public function getTemplateData(Notification $notification, array $options = []): array { return [ 'notification' => $notification, 'period' => $this->accompanyingPeriodRepository->find($notification->getRelatedEntityId()), ]; } public function supports(Notification $notification, array $options = []): bool { return $notification->getRelatedEntityClass() === AccompanyingPeriod::class; } }