mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-15 16:47:36 +00:00
Resolve "Afficher les noms des usagers et l'entité concerné par l'entité notifiée dans la liste des notifications"
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Symfony\Contracts\Translation\TranslatableInterface;
|
||||
|
||||
interface NotificationHandlerInterface
|
||||
{
|
||||
@@ -29,4 +30,13 @@ interface NotificationHandlerInterface
|
||||
* Return true if the handler supports the handling for this notification.
|
||||
*/
|
||||
public function supports(Notification $notification, array $options = []): bool;
|
||||
|
||||
public function getTitle(Notification $notification, array $options = []): TranslatableInterface;
|
||||
|
||||
/*
|
||||
* return list<Person>
|
||||
*/
|
||||
public function getAssociatedPersons(Notification $notification, array $options = []): array;
|
||||
|
||||
public function getRelatedEntity(Notification $notification): ?object;
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@ namespace Chill\MainBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Notification\Exception\NotificationHandlerNotFound;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
final readonly class NotificationHandlerManager
|
||||
{
|
||||
public function __construct(private iterable $handlers, private EntityManagerInterface $em) {}
|
||||
public function __construct(private iterable $handlers) {}
|
||||
|
||||
/**
|
||||
* @throw NotificationHandlerNotFound if handler is not found
|
||||
|
||||
Reference in New Issue
Block a user