src/Entity/EditionTemplateGabaritZone.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\EditionTemplateGabaritZoneRepository")
  8.  */
  9. class EditionTemplateGabaritZone
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplateGabarit", inversedBy="zones")
  19.      * @ORM\JoinColumns({
  20.      *   @ORM\JoinColumn(name="gabarit_id", referencedColumnName="id", onDelete="CASCADE")
  21.      * })
  22.      */
  23.     private $gabarit;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la zone"})
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Identifiant texte de la zone"})
  30.      */
  31.     private $key;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Type d'affichage : INLINE ou STACKED"})
  34.      */
  35.     private $displayMode;
  36.     /**
  37.      * @ORM\Column(type="integer", nullable=true)
  38.      */
  39.     private $ordering;
  40.     /**
  41.      * @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
  42.      */
  43.     private $params;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubriqueZone", mappedBy="templateZone", cascade={"persist"})
  48.      * @ORM\OrderBy({"ordering" = "ASC"})
  49.      */
  50.     private $rubriqueZones;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateParameterGroup", mappedBy="zone")
  53.      */
  54.     private $parameterGroups;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $readOnly;
  59.     public function __construct()
  60.     {
  61.         $this->rubriqueZones = new ArrayCollection();
  62.         $this->parameterGroups = 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 getKey() : ?string
  78.     {
  79.         return $this->key;
  80.     }
  81.     public function setKey(?string $key) : self
  82.     {
  83.         $this->key $key;
  84.         return $this;
  85.     }
  86.     public function getDisplayMode() : ?string
  87.     {
  88.         return $this->displayMode;
  89.     }
  90.     public function setDisplayMode(?string $displayMode) : self
  91.     {
  92.         $this->displayMode $displayMode;
  93.         return $this;
  94.     }
  95.     public function getOrdering() : ?int
  96.     {
  97.         return $this->ordering;
  98.     }
  99.     public function setOrdering(?int $ordering) : self
  100.     {
  101.         $this->ordering $ordering;
  102.         return $this;
  103.     }
  104.     public function getGabarit() : ?EditionTemplateGabarit
  105.     {
  106.         return $this->gabarit;
  107.     }
  108.     public function setGabarit(?EditionTemplateGabarit $gabarit) : self
  109.     {
  110.         $this->gabarit $gabarit;
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Collection|EditionModeleRubriqueZone[]
  115.      */
  116.     public function getRubriqueZones() : Collection
  117.     {
  118.         return $this->rubriqueZones;
  119.     }
  120.     public function addRubriqueZone(EditionModeleRubriqueZone $rubriqueZone) : self
  121.     {
  122.         if (!$this->rubriqueZones->contains($rubriqueZone)) {
  123.             $this->rubriqueZones[] = $rubriqueZone;
  124.             $rubriqueZone->setTemplateZone($this);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removeRubriqueZone(EditionModeleRubriqueZone $rubriqueZone) : self
  129.     {
  130.         if ($this->rubriqueZones->contains($rubriqueZone)) {
  131.             $this->rubriqueZones->removeElement($rubriqueZone);
  132.             // set the owning side to null (unless already changed)
  133.             if ($rubriqueZone->getTemplateZone() === $this) {
  134.                 $rubriqueZone->setTemplateZone(null);
  135.             }
  136.         }
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection|EditionTemplateParameterGroup[]
  141.      */
  142.     public function getParameterGroups() : Collection
  143.     {
  144.         return $this->parameterGroups;
  145.     }
  146.     public function addParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  147.     {
  148.         if (!$this->parameterGroups->contains($parameterGroup)) {
  149.             $this->parameterGroups[] = $parameterGroup;
  150.             $parameterGroup->setZone($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  155.     {
  156.         if ($this->parameterGroups->contains($parameterGroup)) {
  157.             $this->parameterGroups->removeElement($parameterGroup);
  158.             // set the owning side to null (unless already changed)
  159.             if ($parameterGroup->getZone() === $this) {
  160.                 $parameterGroup->setZone(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     public function getReadOnly() : ?bool
  166.     {
  167.         return $this->readOnly;
  168.     }
  169.     public function setReadOnly(?bool $readOnly) : self
  170.     {
  171.         $this->readOnly $readOnly;
  172.         return $this;
  173.     }
  174.     public function getParams() : ?array
  175.     {
  176.         return $this->params;
  177.     }
  178.     public function setParams(?array $params) : self
  179.     {
  180.         $this->params $params;
  181.         return $this;
  182.     }
  183. }