mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
adding location to ranges and more control on MyCalendarRanges
This commit is contained in:
@@ -15,10 +15,12 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Table(
|
||||
@@ -42,7 +44,8 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @groups({"read", "write", "calendar:read"})
|
||||
* @Groups({"read", "write", "calendar:read"})
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?DateTimeImmutable $endDate = null;
|
||||
|
||||
@@ -50,29 +53,54 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
* @groups({"read"})
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @Groups({"read", "write", "calendar:read"})
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?Location $location;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @groups({"read", "write", "calendar:read"})
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?DateTimeImmutable $startDate = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
||||
* @groups({"read", "write", "calendar:read"})
|
||||
* @Groups({"read", "write", "calendar:read"})
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?User $user = null;
|
||||
|
||||
/**
|
||||
* @return Location|null
|
||||
*/
|
||||
public function getLocation(): ?Location
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Location|null $location
|
||||
*/
|
||||
public function setLocation(?Location $location): void
|
||||
{
|
||||
$this->location = $location;
|
||||
}
|
||||
|
||||
|
||||
public function getCalendar(): ?Calendar
|
||||
{
|
||||
return $this->calendar;
|
||||
}
|
||||
|
||||
//TODO Lieu
|
||||
|
||||
public function getEndDate(): ?DateTimeImmutable
|
||||
{
|
||||
return $this->endDate;
|
||||
|
Reference in New Issue
Block a user