src/Entity/EditionNotesPageTemplateParameter.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\EditionNotesPageTemplateParameterRepository")
  8.  */
  9. class EditionNotesPageTemplateParameter
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private int $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé du parametre"})
  19.      */
  20.     private ?string $label;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du parametre"})
  23.      */
  24.     private ?string $key;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du type de paramètre"})
  27.      */
  28.     private ?string $type;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du groupe"})
  31.      */
  32.     private ?string $defaultValue;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private ?int $ordering;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private ?string $helpText;
  41.     /**
  42.      * @ORM\Column(type="json", nullable=true, options={"comment":"options si on choisit une liste"})
  43.      */
  44.     private ?array $options;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionNotesPageTemplateParameterGroup", inversedBy="parameters")
  47.      * @ORM\JoinColumns({
  48.      *   @ORM\JoinColumn(name="group_id", referencedColumnName="id", onDelete="CASCADE")
  49.      * })
  50.      */
  51.     private ?EditionNotesPageTemplateParameterGroup $group;
  52.     /**
  53.      * @var Collection
  54.      *
  55.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleNotesRubriqueParameter", mappedBy="templateParameter", cascade={"persist"})
  56.      * @ORM\OrderBy({"ordering" = "ASC"})
  57.      */
  58.     private $rubriqueParameters;
  59.     public function __construct()
  60.     {
  61.         $this->rubriqueParameters = new ArrayCollection();
  62.     }
  63.     public function getId() : ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getLabel() : ?string
  68.     {
  69.         return $this->label;
  70.     }
  71.     public function setLabel(?string $label) : self
  72.     {
  73.         $this->label $label;
  74.         return $this;
  75.     }
  76.     public function getKey() : ?string
  77.     {
  78.         return $this->key;
  79.     }
  80.     public function setKey(?string $key) : self
  81.     {
  82.         $this->key $key;
  83.         return $this;
  84.     }
  85.     public function getType() : ?string
  86.     {
  87.         return $this->type;
  88.     }
  89.     public function setType(?string $type) : self
  90.     {
  91.         $this->type $type;
  92.         return $this;
  93.     }
  94.     public function getDefaultValue() : ?string
  95.     {
  96.         return $this->defaultValue;
  97.     }
  98.     public function setDefaultValue(?string $defaultValue) : self
  99.     {
  100.         $this->defaultValue $defaultValue;
  101.         return $this;
  102.     }
  103.     public function getOrdering() : ?int
  104.     {
  105.         return $this->ordering;
  106.     }
  107.     public function setOrdering(?int $ordering) : self
  108.     {
  109.         $this->ordering $ordering;
  110.         return $this;
  111.     }
  112.     public function getGroup() : ?EditionNotesPageTemplateParameterGroup
  113.     {
  114.         return $this->group;
  115.     }
  116.     public function setGroup(?EditionNotesPageTemplateParameterGroup $group) : self
  117.     {
  118.         $this->group $group;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection|EditionModeleNotesRubriqueParameter[]
  123.      */
  124.     public function getRubriqueParameters() : Collection
  125.     {
  126.         return $this->rubriqueParameters;
  127.     }
  128.     public function addRubriqueParameter(EditionModeleNotesRubriqueParameter $rubriqueParameter) : self
  129.     {
  130.         if (!$this->rubriqueParameters->contains($rubriqueParameter)) {
  131.             $this->rubriqueParameters[] = $rubriqueParameter;
  132.             $rubriqueParameter->setTemplateParameter($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeRubriqueParameter(EditionModeleNotesRubriqueParameter $rubriqueParameter) : self
  137.     {
  138.         if ($this->rubriqueParameters->contains($rubriqueParameter)) {
  139.             $this->rubriqueParameters->removeElement($rubriqueParameter);
  140.             // set the owning side to null (unless already changed)
  141.             if ($rubriqueParameter->getTemplateParameter() === $this) {
  142.                 $rubriqueParameter->setTemplateParameter(null);
  143.             }
  144.         }
  145.         return $this;
  146.     }
  147.     public function getHelpText() : ?string
  148.     {
  149.         return $this->helpText;
  150.     }
  151.     public function setHelpText(?string $helpText) : self
  152.     {
  153.         $this->helpText $helpText;
  154.         return $this;
  155.     }
  156.     public function getOptions() : ?array
  157.     {
  158.         return $this->options;
  159.     }
  160.     public function setOptions(?array $options) : self
  161.     {
  162.         $this->options $options;
  163.         return $this;
  164.     }
  165. }