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