mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
fix relation inside calendar, bootstrap messenger for handling create and update calendar entity
This commit is contained in:
@@ -17,8 +17,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
@@ -35,10 +33,9 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Calendar::class,
|
||||
* mappedBy="calendarRange")
|
||||
* @ORM\OneToOne(targetEntity=Calendar::class, mappedBy="calendarRange")
|
||||
*/
|
||||
private Collection $calendars;
|
||||
private Calendar $calendar;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
@@ -66,13 +63,13 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?User $user = null;
|
||||
|
||||
//TODO Lieu
|
||||
|
||||
public function __construct()
|
||||
public function getCalendar(): Calendar
|
||||
{
|
||||
$this->calendars = new ArrayCollection();
|
||||
return $this->calendar;
|
||||
}
|
||||
|
||||
//TODO Lieu
|
||||
|
||||
public function getEndDate(): ?DateTimeImmutable
|
||||
{
|
||||
return $this->endDate;
|
||||
@@ -93,6 +90,14 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal use {@link (Calendar::setCalendarRange)} instead
|
||||
*/
|
||||
public function setCalendar(Calendar $calendar): void
|
||||
{
|
||||
$this->calendar = $calendar;
|
||||
}
|
||||
|
||||
public function setEndDate(DateTimeImmutable $endDate): self
|
||||
{
|
||||
$this->endDate = $endDate;
|
||||
|
Reference in New Issue
Block a user