fix relation inside calendar, bootstrap messenger for handling create and update calendar entity

This commit is contained in:
2022-05-25 10:22:30 +02:00
parent b22f361368
commit f962b7543f
10 changed files with 155 additions and 15 deletions

View File

@@ -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;