diff --git a/src/Entity/Event.php b/src/Entity/Event.php index 9fdd412..f921d0c 100755 --- a/src/Entity/Event.php +++ b/src/Entity/Event.php @@ -34,16 +34,23 @@ class Event * @var array */ protected $options = []; + + /** + * @var string + */ + protected $resourceId; public function __construct( string $title, DateTimeInterface $start, ?DateTimeInterface $end = null, + ?string $resourceId = null, array $options = [] ) { $this->setTitle($title); $this->setStart($start); $this->setEnd($end); + $this->setResourceId($resourceId); $this->setOptions($options); } @@ -89,6 +96,16 @@ public function setAllDay(bool $allDay): void { $this->allDay = $allDay; } + + public function getResourceId(): ?string + { + return $this->resourceId; + } + + public function setResourceId(?string $resourceId): void + { + $this->resourceId = $resourceId; + } public function getOptions(): array { @@ -144,6 +161,10 @@ public function toArray(): array if (null !== $this->getEnd()) { $event['end'] = $this->getEnd()->format(self::DATE_FORMAT); } + + if (null !== $this->getResourceId()) { + $event['resourceId'] = $this->getResourceId(); + } return array_merge($event, $this->getOptions()); }