<?phpnamespace App\Entity;use App\Repository\ReservationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: ReservationRepository::class)]class Reservation{ const ONE_WEEK = 1; const TWO_WEEKS = 2; const FOUR_WEEKS = 4; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(["getReservation"])] private ?int $id = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] #[Groups(["getReservation"])] private ?Project $project = null; #[ORM\ManyToOne(inversedBy: 'reservation')] #[ORM\JoinColumn(nullable: false)] #[Groups(["getReservation"])] private ?User $employee = null; #[ORM\Column(type: Types::DATE_MUTABLE)] #[Groups(["getReservation"])] private ?\DateTimeInterface $startDate = null; #[ORM\Column(type: Types::DATE_MUTABLE)] #[Groups(["getReservation"])] private ?\DateTimeInterface $endDate = null; #[ORM\Column(type: Types::TIME_MUTABLE)] #[Groups(["getReservation"])] private ?\DateTimeInterface $startTime = null; #[ORM\Column(type: Types::TIME_MUTABLE)] #[Groups(["getReservation"])] private ?\DateTimeInterface $endTime = null; #[ORM\Column] #[Groups(["getReservation"])] private ?int $occurrence = null; #[ORM\OneToMany(mappedBy: 'reservation', targetEntity: Schedules::class)] #[Groups(["getReservation"])] private Collection $schedules; #[ORM\Column(nullable: true)] #[Groups(["getReservation"])] private ?int $day = null; public function __construct() { $this->schedules = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getProject(): ?Project { return $this->project; } public function setProject(?Project $project): self { $this->project = $project; return $this; } public function getEmployee(): ?User { return $this->employee; } public function setEmployee(?User $employee): self { $this->employee = $employee; return $this; } public function getStartDate(): ?\DateTimeInterface { return $this->startDate; } public function setStartDate(\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?\DateTimeInterface { return $this->endDate; } public function setEndDate(\DateTimeInterface $endDate): self { $this->endDate = $endDate; return $this; } public function getStartTime(): ?\DateTimeInterface { return $this->startTime; } public function setStartTime(\DateTimeInterface $startTime): self { $this->startTime = $startTime; return $this; } public function getEndTime(): ?\DateTimeInterface { return $this->endTime; } public function setEndTime(\DateTimeInterface $endTime): self { $this->endTime = $endTime; return $this; } public function getOccurrence(): ?int { return $this->occurrence; } public function setOccurrence(int $occurrence): self { $this->occurrence = $occurrence; return $this; } /** * @return Collection<int, Schedules> */ public function getSchedules(): Collection { return $this->schedules; } public function addSchedule(Schedules $schedule): self { if (!$this->schedules->contains($schedule)) { $this->schedules->add($schedule); $schedule->setReservation($this); } return $this; } public function removeSchedule(Schedules $schedule): self { if ($this->schedules->removeElement($schedule)) { // set the owning side to null (unless already changed) if ($schedule->getReservation() === $this) { $schedule->setReservation(null); } } return $this; } public function getDay(): ?int { return $this->day; } public function setDay(?int $day): self { $this->day = $day; return $this; }}