src/Entity/EditionTemplateGabarit.php line 14

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