Resolve "Notification aux groupes utilisateurs"

This commit is contained in:
2026-03-16 14:08:35 +00:00
committed by Boris Waaub
parent 0a8d650d95
commit 7873095947
13 changed files with 562 additions and 48 deletions

View File

@@ -11,20 +11,45 @@ declare(strict_types=1);
namespace Chill\MainBundle\Notification\Email\NotificationEmailMessages;
use Chill\MainBundle\Entity\Notification;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserGroup;
readonly class SendImmediateNotificationEmailMessage
{
private int $notificationId;
private ?int $userId;
private ?int $userGroupId;
public function __construct(
private int $notificationId,
private int $addresseeId,
) {}
Notification $notification,
UserGroup|User $addressee,
) {
$this->notificationId = $notification->getId();
if ($addressee instanceof User) {
$this->userId = $addressee->getId();
$this->userGroupId = null;
} else {
$this->userGroupId = $addressee->getId();
$this->userId = null;
}
}
public function getNotificationId(): int
{
return $this->notificationId;
}
public function getAddresseeId(): int
public function getUserId(): ?int
{
return $this->addresseeId;
return $this->userId;
}
public function getUserGroupId(): ?int
{
return $this->userGroupId;
}
}