mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix relation inside calendar, bootstrap messenger for handling create and update calendar entity
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\CalendarBundle\Messenger\Message;
|
||||
|
||||
use Chill\CalendarBundle\Entity\Calendar;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
|
||||
class CalendarMessage
|
||||
{
|
||||
@@ -21,11 +22,14 @@ class CalendarMessage
|
||||
|
||||
private string $action;
|
||||
|
||||
private int $byUserId;
|
||||
|
||||
private int $calendarId;
|
||||
|
||||
public function __construct(Calendar $calendar, string $action)
|
||||
public function __construct(Calendar $calendar, string $action, User $byUser)
|
||||
{
|
||||
$this->calendarId = $calendar->getId();
|
||||
$this->byUserId = $byUser->getId();
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
@@ -34,6 +38,11 @@ class CalendarMessage
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function getByUserId(): ?int
|
||||
{
|
||||
return $this->byUserId;
|
||||
}
|
||||
|
||||
public function getCalendarId(): ?int
|
||||
{
|
||||
return $this->calendarId;
|
||||
|
Reference in New Issue
Block a user