src/Entity/Arrangements.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ArrangementsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ArrangementsRepository::class)
  9.  */
  10. class Arrangements
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $etat;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="arrangement")
  28.      */
  29.     private $sejours;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Pricearrangement::class, mappedBy="arrangement", orphanRemoval=true)
  32.      */
  33.     private $pricearrangements;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Hotelarrangement::class, mappedBy="arrangement", orphanRemoval=true)
  36.      */
  37.     private $hotelarrangements;
  38.     public function __construct()
  39.     {
  40.         $this->sejours = new ArrayCollection();
  41.         $this->pricearrangements = new ArrayCollection();
  42.         $this->hotelarrangements = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getName(): ?string
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function setName(string $name): self
  53.     {
  54.         $this->name $name;
  55.         return $this;
  56.     }
  57.     public function isEtat(): ?bool
  58.     {
  59.         return $this->etat;
  60.     }
  61.     public function setEtat(bool $etat): self
  62.     {
  63.         $this->etat $etat;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Sejour>
  68.      */
  69.     public function getSejours(): Collection
  70.     {
  71.         return $this->sejours;
  72.     }
  73.     public function addSejour(Sejour $sejour): self
  74.     {
  75.         if (!$this->sejours->contains($sejour)) {
  76.             $this->sejours[] = $sejour;
  77.             $sejour->setArrangement($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeSejour(Sejour $sejour): self
  82.     {
  83.         if ($this->sejours->removeElement($sejour)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($sejour->getArrangement() === $this) {
  86.                 $sejour->setArrangement(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     public function __toString()
  92.     {
  93.         return $this->name;
  94.     }
  95.     /**
  96.      * @return Collection<int, Pricearrangement>
  97.      */
  98.     public function getPricearrangements(): Collection
  99.     {
  100.         return $this->pricearrangements;
  101.     }
  102.     public function addPricearrangement(Pricearrangement $pricearrangement): self
  103.     {
  104.         if (!$this->pricearrangements->contains($pricearrangement)) {
  105.             $this->pricearrangements[] = $pricearrangement;
  106.             $pricearrangement->setArrangement($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removePricearrangement(Pricearrangement $pricearrangement): self
  111.     {
  112.         if ($this->pricearrangements->removeElement($pricearrangement)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($pricearrangement->getArrangement() === $this) {
  115.                 $pricearrangement->setArrangement(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, Hotelarrangement>
  122.      */
  123.     public function getHotelarrangements(): Collection
  124.     {
  125.         return $this->hotelarrangements;
  126.     }
  127.     public function addHotelarrangement(Hotelarrangement $hotelarrangement): self
  128.     {
  129.         if (!$this->hotelarrangements->contains($hotelarrangement)) {
  130.             $this->hotelarrangements[] = $hotelarrangement;
  131.             $hotelarrangement->setArrangement($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeHotelarrangement(Hotelarrangement $hotelarrangement): self
  136.     {
  137.         if ($this->hotelarrangements->removeElement($hotelarrangement)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($hotelarrangement->getArrangement() === $this) {
  140.                 $hotelarrangement->setArrangement(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145. }