src/Entity/Chambre.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChambreRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ChambreRepository::class)
  9.  */
  10. class Chambre
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="chambres", cascade={"persist"})
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $product;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $typeChambre;
  27.     /**
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private $NumChambre;
  31.     /**
  32.      * @ORM\Column(type="integer", nullable=true)
  33.      */
  34.     private $nombreLits;
  35.     /**
  36.      * @ORM\Column(type="float", nullable=true)
  37.      */
  38.     private $tarifNuit;
  39.     /**
  40.      * @ORM\Column(type="float", nullable=true)
  41.      */
  42.     private $tarifJour;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      */
  46.     private $imageChambre;
  47.     /**
  48.      * @ORM\ManyToMany(targetEntity=LitsChambre::class, inversedBy="chambres")
  49.      */
  50.     private $typeDeLits;
  51.     /**
  52.      * @ORM\ManyToMany(targetEntity=TypeParticipant::class, inversedBy="chambres")
  53.      */
  54.     private $typeParticipant;
  55.     /**
  56.      * @ORM\Column(type="array", nullable=true)
  57.      */
  58.     private $litChambreData = [];
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=TableUser::class, mappedBy="chambre", cascade={"remove"})
  61.      */
  62.     private $participant;
  63.     public function __construct()
  64.     {
  65.         $this->typeDeLits = new ArrayCollection();
  66.         $this->typeParticipant = new ArrayCollection();
  67.         $this->participant = new ArrayCollection();
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getTypeChambre(): ?string
  74.     {
  75.         return $this->typeChambre;
  76.     }
  77.     public function setTypeChambre(string $typeChambre): self
  78.     {
  79.         $this->typeChambre $typeChambre;
  80.         return $this;
  81.     }
  82.     public function getNumChambre(): ?int
  83.     {
  84.         return $this->NumChambre;
  85.     }
  86.     public function setNumChambre(int $NumChambre): self
  87.     {
  88.         $this->NumChambre $NumChambre;
  89.         return $this;
  90.     }
  91.     public function getNombreLits(): ?int
  92.     {
  93.         return $this->nombreLits;
  94.     }
  95.     public function setNombreLits(int $nombreLits): self
  96.     {
  97.         $this->nombreLits $nombreLits;
  98.         return $this;
  99.     }
  100.     public function getTarifNuit(): ?float
  101.     {
  102.         return $this->tarifNuit;
  103.     }
  104.     public function setTarifNuit(?float $tarifNuit null): self
  105.     {
  106.         $this->tarifNuit $tarifNuit;
  107.         return $this;
  108.     }
  109.     public function getTarifJour(): ?float
  110.     {
  111.         return $this->tarifJour;
  112.     }
  113.     public function setTarifJour(?float $tarifJour null): self
  114.     {
  115.         $this->tarifJour $tarifJour;
  116.         return $this;
  117.     }
  118.     public function getProduct(): ?Product
  119.     {
  120.         return $this->product;
  121.     }
  122.     public function setProduct(?Product $product): self
  123.     {
  124.         $this->product $product;
  125.         return $this;
  126.     }
  127.     public function getImageChambre(): ?string
  128.     {
  129.         return $this->imageChambre;
  130.     }
  131.     public function setImageChambre(?string $imageChambre): self
  132.     {
  133.         $this->imageChambre $imageChambre;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection|LitsChambre[]
  138.      */
  139.     public function getTypeDeLits(): Collection
  140.     {
  141.         return $this->typeDeLits;
  142.     }
  143.     public function addTypeDeLit(LitsChambre $typeDeLit): self
  144.     {
  145.         if (!$this->typeDeLits->contains($typeDeLit)) {
  146.             $this->typeDeLits[] = $typeDeLit;
  147.         }
  148.         return $this;
  149.     }
  150.     public function removeTypeDeLit(LitsChambre $typeDeLit): self
  151.     {
  152.         $this->typeDeLits->removeElement($typeDeLit);
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection|TypeParticipant[]
  157.      */
  158.     public function getTypeParticipant(): Collection
  159.     {
  160.         return $this->typeParticipant;
  161.     }
  162.     public function addTypeParticipant(TypeParticipant $typeParticipant): self
  163.     {
  164.         if (!$this->typeParticipant->contains($typeParticipant)) {
  165.             $this->typeParticipant[] = $typeParticipant;
  166.         }
  167.         return $this;
  168.     }
  169.     public function removeTypeParticipant(TypeParticipant $typeParticipant): self
  170.     {
  171.         $this->typeParticipant->removeElement($typeParticipant);
  172.         return $this;
  173.     }
  174.     public function getLitChambreData(): ?array
  175.     {
  176.         return $this->litChambreData;
  177.     }
  178.     public function setLitChambreData(?array $litChambreData): self
  179.     {
  180.         $this->litChambreData $litChambreData;
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection|TableUser[]
  185.      */
  186.     public function getParticipant(): Collection
  187.     {
  188.         return $this->participant;
  189.     }
  190.     public function addParticipant(TableUser $participant): self
  191.     {
  192.         if (!$this->participant->contains($participant)) {
  193.             $this->participant[] = $participant;
  194.             $participant->setChambre($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeParticipant(TableUser $participant): self
  199.     {
  200.         if ($this->participant->removeElement($participant)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($participant->getChambre() === $this) {
  203.                 $participant->setChambre(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208. }