src/Entity/Circuitroom.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CircuitroomRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CircuitroomRepository::class)
  9.  */
  10. class Circuitroom
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Circuit::class, inversedBy="circuitrooms", cascade={"persist"})
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $circuit;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Chambre::class, inversedBy="circuitrooms", cascade={"persist"})
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $chambre;
  28.     /**
  29.      * @ORM\Column(type="boolean", nullable=true)
  30.      */
  31.     private $etat;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=Circuitpriceroom::class, mappedBy="circuitroom", orphanRemoval=true)
  34.      */
  35.     private $circuitpricerooms;
  36.     public function __construct()
  37.     {
  38.         $this->circuitpricerooms = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCircuit(): ?Circuit
  45.     {
  46.         return $this->circuit;
  47.     }
  48.     public function setCircuit(?Circuit $circuit): self
  49.     {
  50.         $this->circuit $circuit;
  51.         return $this;
  52.     }
  53.     public function getChambre(): ?Chambre
  54.     {
  55.         return $this->chambre;
  56.     }
  57.     public function setChambre(?Chambre $chambre): self
  58.     {
  59.         $this->chambre $chambre;
  60.         return $this;
  61.     }
  62.     public function isEtat(): ?bool
  63.     {
  64.         return $this->etat;
  65.     }
  66.     public function setEtat(?bool $etat): self
  67.     {
  68.         $this->etat $etat;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, Circuitpriceroom>
  73.      */
  74.     public function getCircuitpricerooms(): Collection
  75.     {
  76.         return $this->circuitpricerooms;
  77.     }
  78.     public function addCircuitpriceroom(Circuitpriceroom $circuitpriceroom): self
  79.     {
  80.         if (!$this->circuitpricerooms->contains($circuitpriceroom)) {
  81.             $this->circuitpricerooms[] = $circuitpriceroom;
  82.             $circuitpriceroom->setCircuitroom($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeCircuitpriceroom(Circuitpriceroom $circuitpriceroom): self
  87.     {
  88.         if ($this->circuitpricerooms->removeElement($circuitpriceroom)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($circuitpriceroom->getCircuitroom() === $this) {
  91.                 $circuitpriceroom->setCircuitroom(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96. }