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_old
/
src
/
Entity
/
//srv/data/web/vhosts/716cf56cb2.url-de-test.ws/htdocs_old/src/Entity/Establishment.php
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity(repositoryClass="App\Repository\EstablishmentRepository") */ class Establishment { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $region; /** * @ORM\Column(type="text") */ private $place; /** * @ORM\Column(type="text") */ private $summary; /** * @ORM\Column(type="string", length=255) */ private $address; /** * @ORM\Column(type="string", length=255) * @Assert\Regex("/^[0-9]{4,7}$/") */ private $zipcode; /** * @ORM\Column(type="string", length=255) * @Assert\Regex("/^(0|33)[1-9]([-. ]?[0-9]{2}){4}$/") */ private $phone; /** * @ORM\Column(type="string", length=255) * @Assert\Email */ private $email; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; /** * @ORM\Column(type="boolean") */ private $isActive; /** * @ORM\ManyToMany(targetEntity="App\Entity\Disorder", inversedBy="establishments") */ private $disorders; /** * @ORM\ManyToMany(targetEntity="App\Entity\Facility", inversedBy="establishments") */ private $facilities; /** * @ORM\ManyToMany(targetEntity="App\Entity\PublicWelcomed", inversedBy="establishments") */ private $publics; /** * @ORM\OneToMany(targetEntity="App\Entity\EstablishmentImage", mappedBy="establishment", cascade={"persist", "remove"}) * @Assert\Valid */ private $establishmentImages; /** * @ORM\Column(type="string", length=255) */ private $city; /** * @ORM\OneToOne(targetEntity="App\Entity\Page", inversedBy="establishment", cascade={"persist", "remove"}) */ private $page; /** * @ORM\Column(type="text") */ private $map; /** * @ORM\OneToMany(targetEntity="App\Entity\Offer", mappedBy="establishment") */ private $offers; public function __construct() { $this->isActive = true; $this->createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); $this->disorders = new ArrayCollection(); $this->facilities = new ArrayCollection(); $this->publics = new ArrayCollection(); $this->establishmentImages = new ArrayCollection(); $this->offers = new ArrayCollection(); $this->region = 'Ile-de-France'; } public function __toString() { return $this->getPage()->getTitle(); } public function getId(): ?int { return $this->id; } public function getRegion(): ?string { return $this->region; } public function setRegion(string $region): self { $this->region = $region; return $this; } public function getPlace(): ?string { return $this->place; } public function setPlace(string $place): self { $this->place = $place; return $this; } public function getSummary(): ?string { return $this->summary; } public function setSummary(string $summary): self { $this->summary = $summary; return $this; } public function getAddress(): ?string { return $this->address; } public function setAddress(string $address): self { $this->address = $address; return $this; } public function getZipcode(): ?string { return $this->zipcode; } public function setZipcode(string $zipcode): self { $this->zipcode = $zipcode; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } /** * @return Collection|Disorder[] */ public function getDisorders(): Collection { return $this->disorders; } public function addDisorder(Disorder $disorder): self { if (!$this->disorders->contains($disorder)) { $this->disorders[] = $disorder; } return $this; } public function removeDisorder(Disorder $disorder): self { if ($this->disorders->contains($disorder)) { $this->disorders->removeElement($disorder); } return $this; } /** * @return Collection|Facility[] */ public function getFacilities(): Collection { return $this->facilities; } public function addFacility(Facility $facility): self { if (!$this->facilities->contains($facility)) { $this->facilities[] = $facility; } return $this; } public function removeFacility(Facility $facility): self { if ($this->facilities->contains($facility)) { $this->facilities->removeElement($facility); } return $this; } /** * @return Collection|PublicWelcomed[] */ public function getPublics(): Collection { return $this->publics; } public function addPublic(PublicWelcomed $public): self { if (!$this->publics->contains($public)) { $this->publics[] = $public; } return $this; } public function removePublic(PublicWelcomed $public): self { if ($this->publics->contains($public)) { $this->publics->removeElement($public); } return $this; } /** * @return Collection|EstablishmentImage[] */ public function getEstablishmentImages(): Collection { return $this->establishmentImages; } public function addEstablishmentImage(EstablishmentImage $establishmentImage): self { if (!$this->establishmentImages->contains($establishmentImage)) { $this->establishmentImages[] = $establishmentImage; $establishmentImage->setEstablishment($this); } return $this; } public function removeEstablishmentImage(EstablishmentImage $establishmentImage): self { if ($this->establishmentImages->contains($establishmentImage)) { $this->establishmentImages->removeElement($establishmentImage); // set the owning side to null (unless already changed) if ($establishmentImage->getEstablishment() === $this) { $establishmentImage->setEstablishment(null); } } return $this; } public function getCity(): ?string { return $this->city; } public function setCity(string $city): self { $this->city = $city; return $this; } public function getPage(): ?Page { return $this->page; } public function setPage(?Page $page): self { $this->page = $page; return $this; } public function getMap(): ?string { return $this->map; } public function setMap(string $map): self { $this->map = $map; return $this; } /** * @return Collection|Offer[] */ public function getOffers(): Collection { return $this->offers; } public function addOffer(Offer $offer): self { if (!$this->offers->contains($offer)) { $this->offers[] = $offer; $offer->setEstablishment($this); } return $this; } public function removeOffer(Offer $offer): self { if ($this->offers->contains($offer)) { $this->offers->removeElement($offer); // set the owning side to null (unless already changed) if ($offer->getEstablishment() === $this) { $offer->setEstablishment(null); } } return $this; } }