src/Entity/Modele.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ModeleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=ModeleRepository::class)
  11.  */
  12. class Modele
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="integer", options={"default":0})
  22.      */
  23.     private $nombreBoutons 0;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      * @Assert\NotBlank
  27.      */
  28.     private $libelle;
  29.     /**
  30.      * @ORM\Column(type="integer")
  31.      * @Assert\NotBlank
  32.      */
  33.     private $cout;
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      * @Assert\NotBlank
  37.      */
  38.     private $garantie;
  39.     /**
  40.      * @ORM\Column(type="blob", nullable=true)
  41.      */
  42.     private $photo1;
  43.     /**
  44.      * @ORM\Column(type="blob", nullable=true)
  45.      */
  46.     private $photo2;
  47.     /**
  48.      * @ORM\Column(type="blob", nullable=true)
  49.      */
  50.     private $photo3;
  51.     /**
  52.      * @ORM\Column(type="integer")
  53.      * @Assert\NotBlank
  54.      */
  55.     private $dureeVie;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity=TypeDevice::class, inversedBy="modeles")
  58.      * @Assert\NotBlank
  59.      */
  60.     private $typeDevice;
  61.     /**
  62.      * @ORM\ManyToMany(targetEntity=Reseau::class, inversedBy="modeles", cascade={"persist"})
  63.      */
  64.     private $reseaux;
  65.     /**
  66.      * @ORM\Column(type="text", nullable=true)
  67.      */
  68.     private $description;
  69.     /**
  70.      * @ORM\Column(type="string", length=255)
  71.      * @Assert\NotBlank
  72.      */
  73.     private $fonction;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=Scenario::class, mappedBy="modele")
  76.      */
  77.     private $scenarios;
  78.     /**
  79.      * @ORM\Column(type="boolean")
  80.      */
  81.     private $isArchive 0;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity=Device::class, mappedBy="modele")
  84.      */
  85.     private $devices;
  86.     public function __construct()
  87.     {
  88.         $this->reseaux = new ArrayCollection();
  89.         $this->scenarios = new ArrayCollection();
  90.         $this->devices = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getNombreBoutons(): ?int
  97.     {
  98.         return $this->nombreBoutons;
  99.     }
  100.     public function setNombreBoutons(int $nombreBoutons): self
  101.     {
  102.         $this->nombreBoutons $nombreBoutons;
  103.         return $this;
  104.     }
  105.     public function getLibelle(): ?string
  106.     {
  107.         return $this->libelle;
  108.     }
  109.     public function setLibelle(string $libelle): self
  110.     {
  111.         $this->libelle $libelle;
  112.         return $this;
  113.     }
  114.     public function getCout(): ?int
  115.     {
  116.         return $this->cout;
  117.     }
  118.     public function setCout(int $cout): self
  119.     {
  120.         $this->cout $cout;
  121.         return $this;
  122.     }
  123.     public function getGarantie(): ?int
  124.     {
  125.         return $this->garantie;
  126.     }
  127.     public function setGarantie(int $garantie): self
  128.     {
  129.         $this->garantie $garantie;
  130.         return $this;
  131.     }
  132.     public function getPhoto1()
  133.     {
  134.         return $this->photo1;
  135.     }
  136.     public function setPhoto1($photo1): self
  137.     {
  138.         $this->photo1 $photo1;
  139.         return $this;
  140.     }
  141.     public function getPhoto2()
  142.     {
  143.         return $this->photo2;
  144.     }
  145.     public function setPhoto2($photo2): self
  146.     {
  147.         $this->photo2 $photo2;
  148.         return $this;
  149.     }
  150.     public function getPhoto3()
  151.     {
  152.         return $this->photo3;
  153.     }
  154.     public function setPhoto3($photo3): self
  155.     {
  156.         $this->photo3 $photo3;
  157.         return $this;
  158.     }
  159.     public function getDureeVie(): ?int
  160.     {
  161.         return $this->dureeVie;
  162.     }
  163.     public function setDureeVie(int $dureeVie): self
  164.     {
  165.         $this->dureeVie $dureeVie;
  166.         return $this;
  167.     }
  168.     public function getTypeDevice(): ?TypeDevice
  169.     {
  170.         return $this->typeDevice;
  171.     }
  172.     public function setTypeDevice(?TypeDevice $typeDevice): self
  173.     {
  174.         $this->typeDevice $typeDevice;
  175.         return $this;
  176.     }
  177.     /**
  178.      * @return Collection|Reseau[]
  179.      */
  180.     public function getReseaux(): Collection
  181.     {
  182.         return $this->reseaux;
  183.     }
  184.     public function addReseaux(Reseau $reseaux): self
  185.     {
  186.         if (!$this->reseaux->contains($reseaux)) {
  187.             $this->reseaux[] = $reseaux;
  188.         }
  189.         return $this;
  190.     }
  191.     public function removeReseaux(Reseau $reseaux): self
  192.     {
  193.         if ($this->reseaux->contains($reseaux)) {
  194.             $this->reseaux->removeElement($reseaux);
  195.         }
  196.         return $this;
  197.     }
  198.     public function getDescription(): ?string
  199.     {
  200.         return $this->description;
  201.     }
  202.     public function setDescription(?string $description): self
  203.     {
  204.         $this->description $description;
  205.         return $this;
  206.     }
  207.     public function getFonction(): ?string
  208.     {
  209.         return $this->fonction;
  210.     }
  211.     public function setFonction(string $fonction): self
  212.     {
  213.         $this->fonction $fonction;
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection|Scenario[]
  218.      */
  219.     public function getScenarios(): Collection
  220.     {
  221.         return $this->scenarios;
  222.     }
  223.     public function addScenario(Scenario $scenario): self
  224.     {
  225.         if (!$this->scenarios->contains($scenario)) {
  226.             $this->scenarios[] = $scenario;
  227.             $scenario->setModele($this);
  228.         }
  229.         return $this;
  230.     }
  231.     public function removeScenario(Scenario $scenario): self
  232.     {
  233.         if ($this->scenarios->contains($scenario)) {
  234.             $this->scenarios->removeElement($scenario);
  235.             // set the owning side to null (unless already changed)
  236.             if ($scenario->getModele() === $this) {
  237.                 $scenario->setModele(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     public function getIsArchive(): ?bool
  243.     {
  244.         return $this->isArchive;
  245.     }
  246.     public function setIsArchive(bool $isArchive): self
  247.     {
  248.         $this->isArchive $isArchive;
  249.         return $this;
  250.     }
  251.     /**
  252.      * @return Collection|Device[]
  253.      */
  254.     public function getDevices(): Collection
  255.     {
  256.         return $this->devices;
  257.     }
  258.     public function addDevice(Device $device): self
  259.     {
  260.         if (!$this->devices->contains($device)) {
  261.             $this->devices[] = $device;
  262.             $device->setModele($this);
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeDevice(Device $device): self
  267.     {
  268.         if ($this->devices->contains($device)) {
  269.             $this->devices->removeElement($device);
  270.             // set the owning side to null (unless already changed)
  271.             if ($device->getModele() === $this) {
  272.                 $device->setModele(null);
  273.             }
  274.         }
  275.         return $this;
  276.     }
  277.     public function isArchive(): ?bool
  278.     {
  279.         return $this->isArchive;
  280.     }
  281.     public function isIsArchive(): ?bool
  282.     {
  283.         return $this->isArchive;
  284.     }
  285. }