src/Entity/EditionTemplateParameterGroup.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\EditionTemplateParameterGroupRepository")
  8.  */
  9. class EditionTemplateParameterGroup
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du groupe"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="integer", nullable=true)
  23.      */
  24.     private $ordering;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="parameterGroups")
  27.      * @ORM\JoinColumns({
  28.      *   @ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")
  29.      * })
  30.      */
  31.     private $template;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Indique pour quoi est le groupe : GLOBAL, RUBRIQUE ou SAUT"})
  34.      */
  35.     private $isFor;
  36.     /**
  37.      * @var \Doctrine\Common\Collections\Collection
  38.      *
  39.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateParameter", mappedBy="group", cascade={"persist","remove"})
  40.      * @ORM\OrderBy({"ordering" = "ASC"})
  41.      */
  42.     private $parameters;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplateGabarit", inversedBy="parameterGroups", cascade={"persist"})
  45.      * @ORM\JoinColumns({
  46.      *   @ORM\JoinColumn(name="gabarit_id", referencedColumnName="id", onDelete="SET NULL")
  47.      * })
  48.      */
  49.     private $gabarit;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplateGabaritZone", inversedBy="parameterGroups", cascade={"persist"})
  52.      * @ORM\JoinColumn(name="zone_id", referencedColumnName="id", onDelete="SET NULL")
  53.      */
  54.     private $zone;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"ClĂ© texte du groupe des parametres"})
  57.      */
  58.     private $key;
  59.     public function __construct()
  60.     {
  61.         $this->parameters = new ArrayCollection();
  62.     }
  63.     public function getId() : ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getName() : ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(?string $name) : self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getOrdering() : ?int
  77.     {
  78.         return $this->ordering;
  79.     }
  80.     public function setOrdering(?int $ordering) : self
  81.     {
  82.         $this->ordering $ordering;
  83.         return $this;
  84.     }
  85.     public function getIsFor() : ?string
  86.     {
  87.         return $this->isFor;
  88.     }
  89.     public function setIsFor(?string $isFor) : self
  90.     {
  91.         $this->isFor $isFor;
  92.         return $this;
  93.     }
  94.     public function getTemplate() : ?EditionTemplate
  95.     {
  96.         return $this->template;
  97.     }
  98.     public function setTemplate(?EditionTemplate $template) : self
  99.     {
  100.         $this->template $template;
  101.         return $this;
  102.     }
  103.     /**
  104.      * @return Collection|EditionTemplateParameter[]
  105.      */
  106.     public function getParameters() : Collection
  107.     {
  108.         return $this->parameters;
  109.     }
  110.     public function addParameter(EditionTemplateParameter $parameter) : self
  111.     {
  112.         if (!$this->parameters->contains($parameter)) {
  113.             $this->parameters[] = $parameter;
  114.             $parameter->setGroup($this);
  115.         }
  116.         return $this;
  117.     }
  118.     public function removeParameter(EditionTemplateParameter $parameter) : self
  119.     {
  120.         if ($this->parameters->contains($parameter)) {
  121.             $this->parameters->removeElement($parameter);
  122.             // set the owning side to null (unless already changed)
  123.             if ($parameter->getGroup() === $this) {
  124.                 $parameter->setGroup(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     public function getGabarit() : ?EditionTemplateGabarit
  130.     {
  131.         return $this->gabarit;
  132.     }
  133.     public function setGabarit(?EditionTemplateGabarit $gabarit) : self
  134.     {
  135.         $this->gabarit $gabarit;
  136.         return $this;
  137.     }
  138.     public function getZone() : ?EditionTemplateGabaritZone
  139.     {
  140.         return $this->zone;
  141.     }
  142.     public function setZone(?EditionTemplateGabaritZone $zone) : self
  143.     {
  144.         $this->zone $zone;
  145.         return $this;
  146.     }
  147.     public function getKey() : ?string
  148.     {
  149.         return $this->key;
  150.     }
  151.     public function setKey(?string $key) : self
  152.     {
  153.         $this->key $key;
  154.         return $this;
  155.     }
  156. }