Display notification using services (draft)

This commit is contained in:
Marc Ducobu
2021-06-18 18:05:02 +02:00
parent bdf691a063
commit 282db51f06
15 changed files with 208 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace Chill\ActivityBundle\Notification;
use Chill\MainBundle\Entity\Notification;
use Chill\ActivityBundle\Entity\Activity;
final class ActivityNotificationRenderer
{
public function supports(Notification $notification)
{
return $notification->getRelatedEntityClass() == Activity::class;
}
public function getTemplate()
{
return 'ChillActivityBundle:Activity:showInNotification.html.twig';
}
public function getTemplateData(Notification $notification)
{
return ['notification' => $notification];
}
}