mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
wip: synchro of calendar range
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Messenger\Message;
|
||||
|
||||
use Chill\CalendarBundle\Entity\Calendar;
|
||||
|
||||
class CalendarMessage
|
||||
{
|
||||
public const CALENDAR_PERSIST = 'CHILL_CALENDAR_CALENDAR_PERSIST';
|
||||
|
||||
public const CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE';
|
||||
|
||||
private string $action;
|
||||
|
||||
private int $calendarId;
|
||||
|
||||
public function __construct(Calendar $calendar, string $action)
|
||||
{
|
||||
$this->calendarId = $calendar->getId();
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
public function getAction(): string
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function getCalendarId(): ?int
|
||||
{
|
||||
return $this->calendarId;
|
||||
}
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Messenger\Message;
|
||||
|
||||
use Chill\CalendarBundle\Entity\CalendarRange;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
|
||||
class CalendarRangeMessage
|
||||
{
|
||||
public const CALENDAR_RANGE_PERSIST = 'CHILL_CALENDAR_CALENDAR_RANGE_PERSIST';
|
||||
|
||||
public const CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE';
|
||||
|
||||
private string $action;
|
||||
|
||||
private ?int $byUserId = null;
|
||||
|
||||
private int $calendarRangeId;
|
||||
|
||||
public function __construct(CalendarRange $calendarRange, string $action, ?User $byUser)
|
||||
{
|
||||
$this->action = $action;
|
||||
$this->calendarRangeId = $calendarRange->getId();
|
||||
|
||||
if (null !== $byUser) {
|
||||
$this->byUserId = $byUser->getId();
|
||||
}
|
||||
}
|
||||
|
||||
public function getAction(): string
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function getByUserId(): ?int
|
||||
{
|
||||
return $this->byUserId;
|
||||
}
|
||||
|
||||
public function getCalendarRangeId(): ?int
|
||||
{
|
||||
return $this->calendarRangeId;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user