src/Entity/EditionTemplateGabarit.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\CustomCode;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity (repositoryClass="App\Repository\EditionTemplateGabaritRepository")
  9.  */
  10. class EditionTemplateGabarit
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="gabarits")
  20.      * @ORM\JoinColumns({
  21.      *   @ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")
  22.      * })
  23.      */
  24.     private $template;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du gabarit"})
  27.      */
  28.     private $name;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du gabarit"})
  31.      */
  32.     private $key;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $ordering;
  37.     /**
  38.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du thumbnail"})
  39.      */
  40.     private $thumbnail;
  41.     /**
  42.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin de l'illustration"})
  43.      */
  44.     private $preview;
  45.     /**
  46.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin de la documentation"})
  47.      */
  48.     private $documentation;
  49.     /**
  50.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Dossier où sont stockés les twig du gabarit"})
  51.      */
  52.     private $twigPath;
  53.     /**
  54.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du fichier cssde la feuille de style gabarit"})
  55.      */
  56.     private $cssPath;
  57.     /**
  58.      * @var \Doctrine\Common\Collections\Collection
  59.      *
  60.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateGabaritZone", mappedBy="gabarit", cascade={"persist","remove"})
  61.      * @ORM\OrderBy({"ordering" = "ASC"})
  62.      */
  63.     private $zones;
  64.     /**
  65.      * @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
  66.      */
  67.     private $params;
  68.     /**
  69.      * @var \Doctrine\Common\Collections\Collection
  70.      *
  71.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubrique", mappedBy="gabarit", cascade={"persist"})
  72.      * @ORM\OrderBy({"ordering" = "ASC"})
  73.      */
  74.     private $rubriques;
  75.     /**
  76.      * @var \Doctrine\Common\Collections\Collection
  77.      *
  78.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubriqueDynamiqueModele", mappedBy="gabarit", cascade={"persist"})
  79.      */
  80.     private $rubriqueDynamiqueModeles;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateParameterGroup", mappedBy="gabarit")
  83.      */
  84.     private $parameterGroups;
  85.     /**
  86.      * @ORM\ManyToMany(targetEntity="App\Entity\CustomCode", mappedBy="editionTemplateGabarits")
  87.      */
  88.     private $customCodes;
  89.     public function __construct()
  90.     {
  91.         $this->zones = new ArrayCollection();
  92.         $this->rubriques = new ArrayCollection();
  93.         $this->rubriqueDynamiqueModeles = new ArrayCollection();
  94.         $this->parameterGroups = new ArrayCollection();
  95.         $this->customCodes = new ArrayCollection();
  96.     }
  97.     public function getId() : ?int
  98.     {
  99.         return $this->id;
  100.     }
  101.     public function getName() : ?string
  102.     {
  103.         return $this->name;
  104.     }
  105.     public function setName(?string $name) : self
  106.     {
  107.         $this->name $name;
  108.         return $this;
  109.     }
  110.     public function getDocumentation() : ?string
  111.     {
  112.         return $this->documentation;
  113.     }
  114.     public function setDocumentation(?string $documentation) : self
  115.     {
  116.         $this->documentation $documentation;
  117.         return $this;
  118.     }
  119.     public function getOrdering() : ?int
  120.     {
  121.         return $this->ordering;
  122.     }
  123.     public function setOrdering(?int $ordering) : self
  124.     {
  125.         $this->ordering $ordering;
  126.         return $this;
  127.     }
  128.     public function getTemplate() : ?EditionTemplate
  129.     {
  130.         return $this->template;
  131.     }
  132.     public function setTemplate(?EditionTemplate $template) : self
  133.     {
  134.         $this->template $template;
  135.         return $this;
  136.     }
  137.     public function getThumbnail() : ?string
  138.     {
  139.         return $this->thumbnail;
  140.     }
  141.     public function setThumbnail(?string $thumbnail) : self
  142.     {
  143.         $this->thumbnail $thumbnail;
  144.         return $this;
  145.     }
  146.     public function getPreview() : ?string
  147.     {
  148.         return $this->preview;
  149.     }
  150.     public function setPreview(?string $preview): self
  151.     {
  152.         $this->preview $preview;
  153.         return $this;
  154.     }
  155.     public function getTwigPath() : ?string
  156.     {
  157.         return $this->twigPath;
  158.     }
  159.     public function setTwigPath(?string $path) : self
  160.     {
  161.         $this->twigPath $path;
  162.         return $this;
  163.     }
  164.     public function getCssPath() : ?string
  165.     {
  166.         return $this->cssPath;
  167.     }
  168.     public function setCssPath(?string $path) : self
  169.     {
  170.         $this->cssPath $path;
  171.         return $this;
  172.     }
  173.     /**
  174.      * @return Collection|EditionTemplateGabaritZone[]
  175.      */
  176.     public function getZones() : Collection
  177.     {
  178.         return $this->zones;
  179.     }
  180.     public function addZone(EditionTemplateGabaritZone $zone) : self
  181.     {
  182.         if (!$this->zones->contains($zone)) {
  183.             $this->zones[] = $zone;
  184.             $zone->setGabarit($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removeZone(EditionTemplateGabaritZone $zone) : self
  189.     {
  190.         if ($this->zones->contains($zone)) {
  191.             $this->zones->removeElement($zone);
  192.             // set the owning side to null (unless already changed)
  193.             if ($zone->getGabarit() === $this) {
  194.                 $zone->setGabarit(null);
  195.             }
  196.         }
  197.         return $this;
  198.     }
  199.     /**
  200.      * @return Collection|EditionModeleRubrique[]
  201.      */
  202.     public function getRubriques() : Collection
  203.     {
  204.         return $this->rubriques;
  205.     }
  206.     public function addRubrique(EditionModeleRubrique $rubrique) : self
  207.     {
  208.         if (!$this->rubriques->contains($rubrique)) {
  209.             $this->rubriques[] = $rubrique;
  210.             $rubrique->setGabarit($this);
  211.         }
  212.         return $this;
  213.     }
  214.     public function removeRubrique(EditionModeleRubrique $rubrique) : self
  215.     {
  216.         if ($this->rubriques->contains($rubrique)) {
  217.             $this->rubriques->removeElement($rubrique);
  218.             // set the owning side to null (unless already changed)
  219.             if ($rubrique->getGabarit() === $this) {
  220.                 $rubrique->setGabarit(null);
  221.             }
  222.         }
  223.         return $this;
  224.     }
  225.     /**
  226.      * @return Collection|EditionModeleRubriqueDynamiqueModele[]
  227.      */
  228.     public function getRubriqueDynamiqueModeles() : Collection
  229.     {
  230.         return $this->rubriqueDynamiqueModeles;
  231.     }
  232.     public function addRubriqueDynamiqueModele(EditionModeleRubriqueDynamiqueModele $rubrique) : self
  233.     {
  234.         if (!$this->rubriqueDynamiqueModeles->contains($rubrique)) {
  235.             $this->rubriqueDynamiqueModeles[] = $rubrique;
  236.             $rubrique->setGabarit($this);
  237.         }
  238.         return $this;
  239.     }
  240.     public function removeRubriqueDynamiqueModele(EditionModeleRubriqueDynamiqueModele $rubrique) : self
  241.     {
  242.         if ($this->rubriqueDynamiqueModeles->contains($rubrique)) {
  243.             $this->rubriqueDynamiqueModeles->removeElement($rubrique);
  244.             // set the owning side to null (unless already changed)
  245.             if ($rubrique->getGabarit() === $this) {
  246.                 $rubrique->setGabarit(null);
  247.             }
  248.         }
  249.         return $this;
  250.     }
  251.     /**
  252.      * @return Collection|EditionTemplateParameterGroup[]
  253.      */
  254.     public function getParameterGroups() : Collection
  255.     {
  256.         return $this->parameterGroups;
  257.     }
  258.     public function addParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  259.     {
  260.         if (!$this->parameterGroups->contains($parameterGroup)) {
  261.             $this->parameterGroups[] = $parameterGroup;
  262.             $parameterGroup->setGabarit($this);
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  267.     {
  268.         if ($this->parameterGroups->contains($parameterGroup)) {
  269.             $this->parameterGroups->removeElement($parameterGroup);
  270.             // set the owning side to null (unless already changed)
  271.             if ($parameterGroup->getGabarit() === $this) {
  272.                 $parameterGroup->setGabarit(null);
  273.             }
  274.         }
  275.         return $this;
  276.     }
  277.     public function getKey() : ?string
  278.     {
  279.         return $this->key;
  280.     }
  281.     public function setKey(?string $key) : self
  282.     {
  283.         $this->key $key;
  284.         return $this;
  285.     }
  286.     public function getParams() : ?array
  287.     {
  288.         return $this->params;
  289.     }
  290.     public function setParams(?array $params) : self
  291.     {
  292.         $this->params $params;
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return Collection|CustomCode[]
  297.      */
  298.     public function getCustomCodes () : Collection
  299.     {
  300.         return $this->customCodes;
  301.     }
  302.     public function addCustomCode (CustomCode $code) : self
  303.     {
  304.         if (!$this->customCodes->contains($code)) {
  305.             $this->customCodes[] = $code;
  306.         }
  307.         return $this;
  308.     }
  309.     public function removeCustomCode(CustomCode $code) : self
  310.     {
  311.         if ($this->customCodes->contains($code)) {
  312.             $this->customCodes->removeElement($code);
  313.         }
  314.         return $this;
  315.     }
  316. }