src/Entity/EditionTemplateParameterGroup.php line 14

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