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/Logement.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\LogementRepository; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=LogementRepository::class) */ class Logement { public const APPARTEMENT = "Appartement"; public const VILLA = "Villa"; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer") * @Assert\NotNull(message="Le prix ne doit pas être vide") * @Assert\Positive(message="Le prix doit être superieur à 0") */ private $price; /** * @ORM\Column(type="integer") * @Assert\NotNull(message="Le nombre de lit ne doit pas être vide") * @Assert\Positive(message="Le nombre de lit doit être superieur à 0") */ private $nbLits; /** * @ORM\Column(type="integer") * @Assert\NotNull(message="Le nombre ne doit pas être vide") * @Assert\Positive(message="Le nombre doit être superieur à 0") */ private $nbMaxPersonnes; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="Le nom ne doit pas être vide") */ private $name; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="L'adresse ne doit pas être vide") */ private $address; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="La ville ne doit pas être vide") */ private $city; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="Le code postal ne doit pas être vide") */ private $postaleCode; /** * @ORM\Column(type="datetime_immutable") */ private $createdAt; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ private $updatedAt; /** * @ORM\ManyToMany(targetEntity=Option::class, inversedBy="logements") */ private $options; /** * @ORM\OneToMany(targetEntity=Booking::class, mappedBy="logement") */ private $bookings; /** * @ORM\OneToMany(targetEntity=Ical::class, mappedBy="logement") */ private $icals; /** * @ORM\Column(type="boolean") */ private $isDelete; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $imageName; /** * @ORM\OneToMany(targetEntity=PricesLogements::class, mappedBy="Logement") */ private $pricesLogements; /** * @ORM\OneToMany(targetEntity=ClosureDays::class, mappedBy="logement") */ private $closureDays; /** * @ORM\ManyToMany(targetEntity=Equipment::class, mappedBy="logements") */ private $equipments; /** * @ORM\Column(type="integer") */ private $nbBathroom; /** * @ORM\Column(type="string", length=255) */ private $type; /** * @ORM\Column(type="integer") */ private $nbRoom; /** * @ORM\Column(type="integer") */ private $nbSalon; /** * @ORM\Column(type="integer") */ private $nbCanapeLit; /** * @ORM\Column(type="integer", nullable=true) */ private $orderRank; public function __construct() { $this->createdAt = new \DateTimeImmutable(); $this->isDelete = false; $this->options = new ArrayCollection(); $this->bookings = new ArrayCollection(); $this->icals = new ArrayCollection(); $this->pricesLogements = new ArrayCollection(); $this->closureDays = new ArrayCollection(); $this->equipments = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPrice(): ?int { return $this->price; } public function setPrice(int $price): self { $this->price = $price; return $this; } public function getNbLits(): ?int { return $this->nbLits; } public function setNbLits(int $nbLits): self { $this->nbLits = $nbLits; return $this; } public function getNbMaxPersonnes(): ?int { return $this->nbMaxPersonnes; } public function setNbMaxPersonnes(int $nbMaxPersonnes): self { $this->nbMaxPersonnes = $nbMaxPersonnes; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getAddress(): ?string { return $this->address; } public function setAddress(string $address): self { $this->address = $address; return $this; } public function getCity(): ?string { return $this->city; } public function setCity(string $city): self { $this->city = $city; return $this; } public function getPostaleCode(): ?string { return $this->postaleCode; } public function setPostaleCode(string $postaleCode): self { $this->postaleCode = $postaleCode; 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, Option> */ public function getOptions(): Collection { return $this->options; } public function addOption(Option $option): self { if (!$this->options->contains($option)) { $this->options[] = $option; } return $this; } public function removeOption(Option $option): self { $this->options->removeElement($option); 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->setLogement($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->getLogement() === $this) { $booking->setLogement(null); } } return $this; } /** * @return Collection<int, Ical> */ public function getIcals(): Collection { return $this->icals; } public function addIcal(Ical $ical): self { if (!$this->icals->contains($ical)) { $this->icals[] = $ical; $ical->setLogement($this); } return $this; } public function removeIcal(Ical $ical): self { if ($this->icals->removeElement($ical)) { // set the owning side to null (unless already changed) if ($ical->getLogement() === $this) { $ical->setLogement(null); } } return $this; } public function isIsDelete(): ?bool { return $this->isDelete; } public function setIsDelete(bool $isDelete): self { $this->isDelete = $isDelete; return $this; } public function getImageName(): ?string { return $this->imageName; } public function setImageName(string $imageName): self { $this->imageName = $imageName; return $this; } /** * @return Collection<int, PricesLogements> */ public function getPricesLogements(): Collection { return $this->pricesLogements; } public function addPricesLogement(PricesLogements $pricesLogement): self { if (!$this->pricesLogements->contains($pricesLogement)) { $this->pricesLogements[] = $pricesLogement; $pricesLogement->setLogement($this); } return $this; } public function removePricesLogement(PricesLogements $pricesLogement): self { if ($this->pricesLogements->removeElement($pricesLogement)) { // set the owning side to null (unless already changed) if ($pricesLogement->getLogement() === $this) { $pricesLogement->setLogement(null); } } return $this; } /** * @return Collection<int, ClosureDays> */ public function getClosureDays(): Collection { return $this->closureDays; } public function addClosureDay(ClosureDays $closureDay): self { if (!$this->closureDays->contains($closureDay)) { $this->closureDays[] = $closureDay; $closureDay->setLogement($this); } return $this; } public function removeClosureDay(ClosureDays $closureDay): self { if ($this->closureDays->removeElement($closureDay)) { // set the owning side to null (unless already changed) if ($closureDay->getLogement() === $this) { $closureDay->setLogement(null); } } return $this; } /** * @return Collection<int, Equipment> */ public function getEquipments(): Collection { return $this->equipments; } public function addEquipment(Equipment $equipment): self { if (!$this->equipments->contains($equipment)) { $this->equipments[] = $equipment; $equipment->addLogement($this); } return $this; } public function removeEquipment(Equipment $equipment): self { if ($this->equipments->removeElement($equipment)) { $equipment->removeLogement($this); } return $this; } public function getNbBathroom(): ?int { return $this->nbBathroom; } public function setNbBathroom(int $nbBathroom): self { $this->nbBathroom = $nbBathroom; return $this; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } public function getNbRoom(): ?int { return $this->nbRoom; } public function setNbRoom(int $nbRoom): self { $this->nbRoom = $nbRoom; return $this; } public function getNbSalon(): ?int { return $this->nbSalon; } public function setNbSalon(int $nbSalon): self { $this->nbSalon = $nbSalon; return $this; } public function getNbCanapeLit(): ?int { return $this->nbCanapeLit; } public function setNbCanapeLit(int $nbCanapeLit): self { $this->nbCanapeLit = $nbCanapeLit; return $this; } public function getOrderRank(): ?int { return $this->orderRank; } public function setOrderRank(?int $orderRank): self { $this->orderRank = $orderRank; return $this; } }