Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
716cf56cb2.url-de-test.ws
/
htdocs
/
src
/
Entity
/
/srv/data/web/vhosts/716cf56cb2.url-de-test.ws/htdocs/src/Entity/Saison.php
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Symfony\Component\Validator\Constraints as Assert; use App\Repository\SaisonRepository; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=SaisonRepository::class) */ class Saison { public const HAUTE_SAISON = "HAUTE SAISON"; public const BASSE_SAISON = "BASSE SAISON"; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="Le nom ne doit pas ĂȘtre vide") */ private $name; /** * @ORM\Column(type="text", nullable=true) * @Assert\NotBlank(message="La description ne doit pas ĂȘtre vide") */ private $description; /** * @ORM\Column(type="datetime_immutable") */ private $createdAt; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=Booking::class, mappedBy="saison") */ private $bookings; /** * @ORM\Column(type="date_immutable") */ private $date; public function __construct() { $this->createdAt = new \DateTimeImmutable(); $this->bookings = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection<int, Booking> */ public function getBookings(): Collection { return $this->bookings; } public function addBooking(Booking $booking): self { if (!$this->bookings->contains($booking)) { $this->bookings[] = $booking; $booking->setSaison($this); } return $this; } public function removeBooking(Booking $booking): self { if ($this->bookings->removeElement($booking)) { // set the owning side to null (unless already changed) if ($booking->getSaison() === $this) { $booking->setSaison(null); } } return $this; } public function getDate(): ?\DateTimeImmutable { return $this->date; } public function setDate(\DateTimeImmutable $date): self { $this->date = $date; return $this; } }