src/Entity/EditionContentsPageTemplateParameterGroup.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\EditionContentsPageTemplateParameterGroupRepository")
  8.  */
  9. class EditionContentsPageTemplateParameterGroup
  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\EditionContentsPageTemplate", 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 : ici toujours CONTENTS", "default":"CONTENTS"})
  34.      */
  35.     private $isFor;
  36.     /**
  37.      * @var \Doctrine\Common\Collections\Collection
  38.      *
  39.      * @ORM\OneToMany(targetEntity="App\Entity\EditionContentsPageTemplateParameter", mappedBy="group", cascade={"persist","remove"})
  40.      * @ORM\OrderBy({"ordering" = "ASC"})
  41.      */
  42.     private $parameters;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"ClĂ© texte du groupe des parametres"})
  45.      */
  46.     private $key;
  47.     public function __construct()
  48.     {
  49.         $this->parameters = new ArrayCollection();
  50.     }
  51.     public function getId() : ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getName() : ?string
  56.     {
  57.         return $this->name;
  58.     }
  59.     public function setName(?string $name) : self
  60.     {
  61.         $this->name $name;
  62.         return $this;
  63.     }
  64.     public function getOrdering() : ?int
  65.     {
  66.         return $this->ordering;
  67.     }
  68.     public function setOrdering(?int $ordering) : self
  69.     {
  70.         $this->ordering $ordering;
  71.         return $this;
  72.     }
  73.     public function getIsFor() : ?string
  74.     {
  75.         return $this->isFor;
  76.     }
  77.     public function setIsFor(?string $isFor) : self
  78.     {
  79.         $this->isFor $isFor;
  80.         return $this;
  81.     }
  82.     public function getTemplate() : ?EditionContentsPageTemplate
  83.     {
  84.         return $this->template;
  85.     }
  86.     public function setTemplate(?EditionContentsPageTemplate $template) : self
  87.     {
  88.         $this->template $template;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection|EditionContentsPageTemplateParameter[]
  93.      */
  94.     public function getParameters() : Collection
  95.     {
  96.         return $this->parameters;
  97.     }
  98.     public function addParameter(EditionContentsPageTemplateParameter $parameter) : self
  99.     {
  100.         if (!$this->parameters->contains($parameter)) {
  101.             $this->parameters[] = $parameter;
  102.             $parameter->setGroup($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeParameter(EditionContentsPageTemplateParameter $parameter) : self
  107.     {
  108.         if ($this->parameters->contains($parameter)) {
  109.             $this->parameters->removeElement($parameter);
  110.             // set the owning side to null (unless already changed)
  111.             if ($parameter->getGroup() === $this) {
  112.                 $parameter->setGroup(null);
  113.             }
  114.         }
  115.         return $this;
  116.     }
  117.     public function getKey() : ?string
  118.     {
  119.         return $this->key;
  120.     }
  121.     public function setKey(?string $key) : self
  122.     {
  123.         $this->key $key;
  124.         return $this;
  125.     }
  126. }