src/Entity/Canal.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CanalRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CanalRepository::class)
  9.  */
  10. class Canal
  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 $wording;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=DemandeByCanal::class, mappedBy="canal")
  24.      */
  25.     private $demandeByCanals;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=DemandePro::class, mappedBy="canal")
  28.      */
  29.     private $demandePros
  30.     public function __construct()
  31.     {
  32.         $this->demandeByCanals = new ArrayCollection();
  33.         $this->demandePros = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getWording(): ?string
  40.     {
  41.         return $this->wording;
  42.     }
  43.     public function setWording(string $wording): self
  44.     {
  45.         $this->wording $wording;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection<int, DemandeByCanal>
  50.      */
  51.     public function getDemandeByCanals(): Collection
  52.     {
  53.         return $this->demandeByCanals;
  54.     }
  55.     public function addDemandeByCanal(DemandeByCanal $demandeByCanal): self
  56.     {
  57.         if (!$this->demandeByCanals->contains($demandeByCanal)) {
  58.             $this->demandeByCanals[] = $demandeByCanal;
  59.             $demandeByCanal->setCanal($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function removeDemandeByCanal(DemandeByCanal $demandeByCanal): self
  64.     {
  65.         if ($this->demandeByCanals->removeElement($demandeByCanal)) {
  66.             // set the owning side to null (unless already changed)
  67.             if ($demandeByCanal->getCanal() === $this) {
  68.                 $demandeByCanal->setCanal(null);
  69.             }
  70.         }
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, DemandePro>
  75.      */
  76.     public function getDemandePros(): Collection
  77.     {
  78.         return $this->demandePros;
  79.     }
  80.     public function addDemandePro(DemandePro $demandePro): self
  81.     {
  82.         if (!$this->demandePros->contains($demandePro)) {
  83.             $this->demandePros[] = $demandePro;
  84.             $demandePro->setCanal($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeDemandePro(DemandePro $demandePro): self
  89.     {
  90.         if ($this->demandePros->removeElement($demandePro)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($demandePro->getCanal() === $this) {
  93.                 $demandePro->setCanal(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98. }