src/Entity/Hebergement.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HebergementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass=HebergementRepository::class)
  10.  */
  11. class Hebergement
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * Slug immuable et unique (ex: "st-lucie")
  25.      * @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
  26.      * @ORM\Column(type="string", length=180, unique=true)
  27.      */
  28.     private $slug;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=TypeHebergement::class, inversedBy="hebergements")
  31.      */
  32.     private $type;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $star;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $capacity;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $description;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $img;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $banner;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $adress;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $city;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity=Destination::class, inversedBy="hebergements")
  63.      */
  64.     private $country;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $website;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=OfferHebergement::class, mappedBy="hebergement")
  71.      */
  72.     private $offerHebergements;
  73.     public function __construct()
  74.     {
  75.         $this->offerHebergements = new ArrayCollection();
  76.     }
  77.     public function getId(): ?int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function getType(): ?TypeHebergement
  82.     {
  83.         return $this->type;
  84.     }
  85.     public function setType(?TypeHebergement $type): self
  86.     {
  87.         $this->type $type;
  88.         return $this;
  89.     }
  90.     public function getStar(): ?string
  91.     {
  92.         return $this->star;
  93.     }
  94.     public function setStar(?string $star): self
  95.     {
  96.         $this->star $star;
  97.         return $this;
  98.     }
  99.     public function getCapacity(): ?string
  100.     {
  101.         return $this->capacity;
  102.     }
  103.     public function setCapacity(?string $capacity): self
  104.     {
  105.         $this->capacity $capacity;
  106.         return $this;
  107.     }
  108.     public function getDescription(): ?string
  109.     {
  110.         return $this->description;
  111.     }
  112.     public function setDescription(?string $description): self
  113.     {
  114.         $this->description $description;
  115.         return $this;
  116.     }
  117.     public function getImg(): ?string
  118.     {
  119.         return $this->img;
  120.     }
  121.     public function setImg(?string $img): self
  122.     {
  123.         $this->img $img;
  124.         return $this;
  125.     }
  126.     public function getBanner(): ?string
  127.     {
  128.         return $this->banner;
  129.     }
  130.     public function setBanner(?string $banner): self
  131.     {
  132.         $this->banner $banner;
  133.         return $this;
  134.     }
  135.     public function getAdress(): ?string
  136.     {
  137.         return $this->adress;
  138.     }
  139.     public function setAdress(?string $adress): self
  140.     {
  141.         $this->adress $adress;
  142.         return $this;
  143.     }
  144.     public function getCity(): ?string
  145.     {
  146.         return $this->city;
  147.     }
  148.     public function setCity(?string $city): self
  149.     {
  150.         $this->city $city;
  151.         return $this;
  152.     }
  153.     public function getCountry(): ?Destination
  154.     {
  155.         return $this->country;
  156.     }
  157.     public function setCountry(?Destination $country): self
  158.     {
  159.         $this->country $country;
  160.         return $this;
  161.     }
  162.     public function getWebsite(): ?string
  163.     {
  164.         return $this->website;
  165.     }
  166.     public function setWebsite(?string $website): self
  167.     {
  168.         $this->website $website;
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return Collection<int, OfferHebergement>
  173.      */
  174.     public function getOfferHebergements(): Collection
  175.     {
  176.         return $this->offerHebergements;
  177.     }
  178.     public function addOfferHebergement(OfferHebergement $offerHebergement): self
  179.     {
  180.         if (!$this->offerHebergements->contains($offerHebergement)) {
  181.             $this->offerHebergements[] = $offerHebergement;
  182.             $offerHebergement->setHebergement($this);
  183.         }
  184.         return $this;
  185.     }
  186.     public function removeOfferHebergement(OfferHebergement $offerHebergement): self
  187.     {
  188.         if ($this->offerHebergements->removeElement($offerHebergement)) {
  189.             // set the owning side to null (unless already changed)
  190.             if ($offerHebergement->getHebergement() === $this) {
  191.                 $offerHebergement->setHebergement(null);
  192.             }
  193.         }
  194.         return $this;
  195.     }
  196.     /**
  197.      * Get slug immuable et unique (ex: "st-lucie")
  198.      */ 
  199.     public function getSlug()
  200.     {
  201.         return $this->slug;
  202.     }
  203.     /**
  204.      * Set slug immuable et unique (ex: "st-lucie")
  205.      *
  206.      * @return  self
  207.      */ 
  208.     public function setSlug($slug)
  209.     {
  210.         $this->slug $slug;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get the value of name
  215.      */ 
  216.     public function getName()
  217.     {
  218.         return $this->name;
  219.     }
  220.     /**
  221.      * Set the value of name
  222.      *
  223.      * @return  self
  224.      */ 
  225.     public function setName($name)
  226.     {
  227.         $this->name $name;
  228.         return $this;
  229.     }
  230. }