src/Entity/Reseau.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReseauRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ReseauRepository::class)
  9.  */
  10. class Reseau
  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 $libelle;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=Modele::class, mappedBy="reseaux", cascade={"persist"})
  24.      */
  25.     private $modeles;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=TypeDevice::class, mappedBy="reseaux")
  28.      */
  29.     private $typeDevices;
  30.     public function __construct()
  31.     {
  32.         $this->modeles = new ArrayCollection();
  33.         $this->typeDevices = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getLibelle(): ?string
  40.     {
  41.         return $this->libelle;
  42.     }
  43.     public function setLibelle(string $libelle): self
  44.     {
  45.         $this->libelle $libelle;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection|Modele[]
  50.      */
  51.     public function getModeles(): Collection
  52.     {
  53.         return $this->modeles;
  54.     }
  55.     public function addModele(Modele $modele): self
  56.     {
  57.         if (!$this->modeles->contains($modele)) {
  58.             $this->modeles[] = $modele;
  59.             $modele->addReseaux($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function removeModele(Modele $modele): self
  64.     {
  65.         if ($this->modeles->contains($modele)) {
  66.             $this->modeles->removeElement($modele);
  67.             $modele->removeReseaux($this);
  68.         }
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection|TypeDevice[]
  73.      */
  74.     public function getTypeDevices(): Collection
  75.     {
  76.         return $this->typeDevices;
  77.     }
  78.     public function addTypeDevice(TypeDevice $typeDevice): self
  79.     {
  80.         if (!$this->typeDevices->contains($typeDevice)) {
  81.             $this->typeDevices[] = $typeDevice;
  82.             $typeDevice->addReseaux($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeTypeDevice(TypeDevice $typeDevice): self
  87.     {
  88.         if ($this->typeDevices->contains($typeDevice)) {
  89.             $this->typeDevices->removeElement($typeDevice);
  90.             $typeDevice->removeReseaux($this);
  91.         }
  92.         return $this;
  93.     }
  94. }