Entity Event add resourceId
Nelly34 opened this issue · comments
Hi,
I use your bundle with fullcalendar 5.9 and it works perfectly. But I would like use it with fullcalendar-scheduler and I need an additional filed in Event entity like this:
/**
* @var string
*/
protected $resourceId;
/**
* @var array
*/
protected $options = [];
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);
}
public function getResourceId(): ?string
{
return $this->resourceId;
}
public function setResourceId(?string $resourceId): void
{
$this->resourceId = $resourceId;
}
public function toArray(): array
{
$event = [
'title' => $this->getTitle(),
'start' => $this->getStart()->format(self::DATE_FORMAT),
'allDay' => $this->isAllDay(),
];
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());
}
Is it possible to modify your bundle in this way ?
Thanks
Hi feel free to wrote a pull request :)
Thanks for the merge. Is it possible to tag the master branch.
Composer search the last tag and I don't receive the modification in master branch.
Hi sure sorry I forgot that's done https://github.com/tattali/CalendarBundle/releases/tag/v1.2.2
thanks