src/Entity/EditionTemplate.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",    indexes={@ORM\Index(name="edition_template_key", columns={"key"})})
  8.  * @ORM\Entity (repositoryClass="App\Repository\EditionTemplateRepository")
  9.  */
  10. class EditionTemplate
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du template"})
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"ClĂ© du template"})
  24.      */
  25.     private $key;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"URL du fichier CSS du template"})
  28.      */
  29.     private $urlCss;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Dossier de rangement du template"})
  32.      */
  33.     private $templateFolder;
  34.     /**
  35.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du service"})
  36.      */
  37.     private $serviceName;
  38.     /**
  39.      * @ORM\Column(type="boolean", nullable=false, options={"default":true})
  40.      */
  41.     private $visibleForAll;
  42.     /**
  43.      * @var \Doctrine\Common\Collections\Collection
  44.      *
  45.      * @ORM\ManyToMany(targetEntity="App\Entity\DnsitEntity")
  46.      * @ORM\JoinTable(name="edition_template_entity",
  47.      *      joinColumns={@ORM\JoinColumn(name="template_id", referencedColumnName="id")},
  48.      *      inverseJoinColumns={@ORM\JoinColumn(name="entity_id", referencedColumnName="id")}
  49.      *      )
  50.      */
  51.     private $authorizedEntities;
  52.     /**
  53.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin de la documentation"})
  54.      */
  55.     private $documentation;
  56.     /**
  57.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du thumbnail"})
  58.      */
  59.     private $thumbnail;
  60.     /**
  61.      * @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
  62.      */
  63.     private $params;
  64.     /**
  65.      * @var \Doctrine\Common\Collections\Collection
  66.      *
  67.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateParameterGroup", mappedBy="template", cascade={"persist","remove"})
  68.      * @ORM\OrderBy({"ordering" = "ASC"})
  69.      */
  70.     private $parameterGroups;
  71.     /**
  72.      * @var \Doctrine\Common\Collections\Collection
  73.      *
  74.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateGabarit", mappedBy="template", cascade={"persist","remove"}, orphanRemoval=true)
  75.      * @ORM\OrderBy({"ordering" = "ASC"})
  76.      */
  77.     private $gabarits;
  78.     /**
  79.      * @var \Doctrine\Common\Collections\Collection
  80.      *
  81.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateTetiere", mappedBy="template", cascade={"persist","remove"}, orphanRemoval=true)
  82.      * @ORM\OrderBy({"ordering" = "ASC"})
  83.      */
  84.     private $tetieres;
  85.     /**
  86.      * @var \Doctrine\Common\Collections\Collection
  87.      *
  88.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateEntete", mappedBy="template", cascade={"persist","remove"}, orphanRemoval=true)
  89.      * @ORM\OrderBy({"ordering" = "ASC"})
  90.      */
  91.     private $entetes;
  92.     /**
  93.      * @var \Doctrine\Common\Collections\Collection
  94.      *
  95.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplatePied", mappedBy="template", cascade={"persist","remove"}, orphanRemoval=true)
  96.      * @ORM\OrderBy({"ordering" = "ASC"})
  97.      */
  98.     private $pieds;
  99.     /**
  100.      * @var \Doctrine\Common\Collections\Collection
  101.      *
  102.      * @ORM\OneToMany(targetEntity="App\Entity\EditionTemplateVariant", mappedBy="template", cascade={"persist","remove"})
  103.      * @ORM\OrderBy({"ordering" = "ASC"})
  104.      */
  105.     private $variants;
  106.     /**
  107.      * @var \Doctrine\Common\Collections\Collection
  108.      *
  109.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModele", mappedBy="template", cascade={"persist","remove"})
  110.      */
  111.     private $modeles;
  112.     /**
  113.      * @var \Doctrine\Common\Collections\Collection
  114.      *
  115.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubriqueDynamiqueModele", mappedBy="template", cascade={"persist","remove"})
  116.      */
  117.     private $modeleRubriqueDynamiqueModeles;
  118.     /**
  119.      * @ORM\ManyToMany(targetEntity="App\Entity\CustomCode", mappedBy="editionTemplates")
  120.      */
  121.     private $customCodes;
  122.     public function __construct()
  123.     {
  124.         $this->authorizedEntities = new ArrayCollection();
  125.         $this->parameterGroups = new ArrayCollection();
  126.         $this->gabarits = new ArrayCollection();
  127.         $this->tetieres = new ArrayCollection();
  128.         $this->entetes = new ArrayCollection();
  129.         $this->pieds = new ArrayCollection();
  130.         $this->modeles = new ArrayCollection();
  131.         $this->modeleRubriqueDynamiqueModeles = new ArrayCollection();
  132.         $this->variants = new ArrayCollection();
  133.         $this->customCodes = new ArrayCollection();
  134.     }
  135.     public function getId() : ?int
  136.     {
  137.         return $this->id;
  138.     }
  139.     public function getName() : ?string
  140.     {
  141.         return $this->name;
  142.     }
  143.     public function setName(?string $name) : self
  144.     {
  145.         $this->name $name;
  146.         return $this;
  147.     }
  148.     public function getKey() : ?string
  149.     {
  150.         return $this->key;
  151.     }
  152.     public function setKey(?string $key) : self
  153.     {
  154.         $this->key $key;
  155.         return $this;
  156.     }
  157.     public function getUrlCss() : ?string
  158.     {
  159.         return $this->urlCss;
  160.     }
  161.     public function setUrlCss(?string $url) : self
  162.     {
  163.         $this->urlCss $url;
  164.         return $this;
  165.     }
  166.     public function getTemplateFolder() : ?string
  167.     {
  168.         return $this->templateFolder;
  169.     }
  170.     public function setTemplateFolder(?string $folder) : self
  171.     {
  172.         $this->templateFolder $folder;
  173.         return $this;
  174.     }
  175.     public function getServiceName() : ?string
  176.     {
  177.         return $this->serviceName;
  178.     }
  179.     public function setServiceName(?string $serviceName) : self
  180.     {
  181.         $this->serviceName $serviceName;
  182.         return $this;
  183.     }
  184.     public function getVisibleForAll() : ?bool
  185.     {
  186.         return $this->visibleForAll;
  187.     }
  188.     public function setVisibleForAll(bool $visibleForAll) : self
  189.     {
  190.         $this->visibleForAll $visibleForAll;
  191.         return $this;
  192.     }
  193.     /**
  194.      * @return Collection|DnsitEntity[]
  195.      */
  196.     public function getAuthorizedEntities() : Collection
  197.     {
  198.         return $this->authorizedEntities;
  199.     }
  200.     public function addAuthorizedEntity(DnsitEntity $authorizedEntity) : self
  201.     {
  202.         if (!$this->authorizedEntities->contains($authorizedEntity)) {
  203.             $this->authorizedEntities[] = $authorizedEntity;
  204.         }
  205.         return $this;
  206.     }
  207.     public function removeAuthorizedEntity(DnsitEntity $authorizedEntity) : self
  208.     {
  209.         if ($this->authorizedEntities->contains($authorizedEntity)) {
  210.             $this->authorizedEntities->removeElement($authorizedEntity);
  211.         }
  212.         return $this;
  213.     }
  214.     public function getDocumentation() : ?string
  215.     {
  216.         return $this->documentation;
  217.     }
  218.     public function setDocumentation(?string $documentation) : self
  219.     {
  220.         $this->documentation $documentation;
  221.         return $this;
  222.     }
  223.     public function getThumbnail() : ?string
  224.     {
  225.         return $this->thumbnail;
  226.     }
  227.     public function setThumbnail(?string $thumbnail) : self
  228.     {
  229.         $this->thumbnail $thumbnail;
  230.         return $this;
  231.     }
  232.     /**
  233.      * @return Collection|EditionTemplateParameterGroup[]
  234.      */
  235.     public function getParameterGroups() : Collection
  236.     {
  237.         return $this->parameterGroups;
  238.     }
  239.     public function addParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  240.     {
  241.         if (!$this->parameterGroups->contains($parameterGroup)) {
  242.             $this->parameterGroups[] = $parameterGroup;
  243.             $parameterGroup->setTemplate($this);
  244.         }
  245.         return $this;
  246.     }
  247.     public function removeParameterGroup(EditionTemplateParameterGroup $parameterGroup) : self
  248.     {
  249.         if ($this->parameterGroups->contains($parameterGroup)) {
  250.             $this->parameterGroups->removeElement($parameterGroup);
  251.             // set the owning side to null (unless already changed)
  252.             if ($parameterGroup->getTemplate() === $this) {
  253.                 $parameterGroup->setTemplate(null);
  254.             }
  255.         }
  256.         return $this;
  257.     }
  258.     /**
  259.      * @return Collection|EditionTemplateGabarit[]
  260.      */
  261.     public function getGabarits() : Collection
  262.     {
  263.         return $this->gabarits;
  264.     }
  265.     public function addGabarit(EditionTemplateGabarit $gabarit) : self
  266.     {
  267.         if (!$this->gabarits->contains($gabarit)) {
  268.             $this->gabarits[] = $gabarit;
  269.             $gabarit->setTemplate($this);
  270.         }
  271.         return $this;
  272.     }
  273.     public function removeGabarit(EditionTemplateGabarit $gabarit) : self
  274.     {
  275.         if ($this->gabarits->contains($gabarit)) {
  276.             $this->gabarits->removeElement($gabarit);
  277.             // set the owning side to null (unless already changed)
  278.             if ($gabarit->getTemplate() === $this) {
  279.                 $gabarit->setTemplate(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     /**
  285.      * @return Collection|EditionTemplateTetiere[]
  286.      */
  287.     public function getTetieres() : Collection
  288.     {
  289.         return $this->tetieres;
  290.     }
  291.     public function addTetiere(EditionTemplateTetiere $tetiere) : self
  292.     {
  293.         if (!$this->tetieres->contains($tetiere)) {
  294.             $this->tetieres[] = $tetiere;
  295.             $tetiere->setTemplate($this);
  296.         }
  297.         return $this;
  298.     }
  299.     public function removeTetiere(EditionTemplateTetiere $tetiere) : self
  300.     {
  301.         if ($this->tetieres->contains($tetiere)) {
  302.             $this->tetieres->removeElement($tetiere);
  303.             // set the owning side to null (unless already changed)
  304.             if ($tetiere->getTemplate() === $this) {
  305.                 $tetiere->setTemplate(null);
  306.             }
  307.         }
  308.         return $this;
  309.     }
  310.     /**
  311.      * @return Collection|EditionTemplateEntete[]
  312.      */
  313.     public function getEntetes() : Collection
  314.     {
  315.         return $this->entetes;
  316.     }
  317.     public function addEntete(EditionTemplateEntete $entete) : self
  318.     {
  319.         if (!$this->entetes->contains($entete)) {
  320.             $this->entetes[] = $entete;
  321.             $entete->setTemplate($this);
  322.         }
  323.         return $this;
  324.     }
  325.     public function removeEntete(EditionTemplateEntete $entete) : self
  326.     {
  327.         if ($this->entetes->contains($entete)) {
  328.             $this->entetes->removeElement($entete);
  329.             // set the owning side to null (unless already changed)
  330.             if ($entete->getTemplate() === $this) {
  331.                 $entete->setTemplate(null);
  332.             }
  333.         }
  334.         return $this;
  335.     }
  336.     /**
  337.      * @return Collection|EditionTemplatePied[]
  338.      */
  339.     public function getPieds() : Collection
  340.     {
  341.         return $this->pieds;
  342.     }
  343.     public function addPied(EditionTemplatePied $pied) : self
  344.     {
  345.         if (!$this->pieds->contains($pied)) {
  346.             $this->pieds[] = $pied;
  347.             $pied->setTemplate($this);
  348.         }
  349.         return $this;
  350.     }
  351.     public function removePied(EditionTemplatePied $pied) : self
  352.     {
  353.         if ($this->pieds->contains($pied)) {
  354.             $this->pieds->removeElement($pied);
  355.             // set the owning side to null (unless already changed)
  356.             if ($pied->getTemplate() === $this) {
  357.                 $pied->setTemplate(null);
  358.             }
  359.         }
  360.         return $this;
  361.     }
  362.     /**
  363.      * @return Collection|EditionModele[]
  364.      */
  365.     public function getModeles() : Collection
  366.     {
  367.         return $this->modeles;
  368.     }
  369.     public function addModele(EditionModele $modele) : self
  370.     {
  371.         if (!$this->modeles->contains($modele)) {
  372.             $this->modeles[] = $modele;
  373.             $modele->setTemplate($this);
  374.         }
  375.         return $this;
  376.     }
  377.     public function removeModele(EditionModele $modele) : self
  378.     {
  379.         if ($this->modeles->contains($modele)) {
  380.             $this->modeles->removeElement($modele);
  381.             // set the owning side to null (unless already changed)
  382.             if ($modele->getTemplate() === $this) {
  383.                 $modele->setTemplate(null);
  384.             }
  385.         }
  386.         return $this;
  387.     }
  388.     /**
  389.      * @return Collection|EditionModeleRubriqueDynamiqueModele[]
  390.      */
  391.     public function getModeleRubriqueDynamiqueModeles() : Collection
  392.     {
  393.         return $this->modeleRubriqueDynamiqueModeles;
  394.     }
  395.     public function addModeleRubriqueDynamiqueModele(EditionModeleRubriqueDynamiqueModele $modeleRubrique) : self
  396.     {
  397.         if (!$this->modeleRubriqueDynamiqueModeles->contains($modeleRubrique)) {
  398.             $this->modeleRubriqueDynamiqueModeles[] = $modeleRubrique;
  399.             $modeleRubrique->setTemplate($this);
  400.         }
  401.         return $this;
  402.     }
  403.     public function removeModeleRubriqueDynamiqueModele(EditionModeleRubriqueDynamiqueModele $modeleRubrique) : self
  404.     {
  405.         if ($this->modeleRubriqueDynamiqueModeles->contains($modeleRubrique)) {
  406.             $this->modeleRubriqueDynamiqueModeles->removeElement($modeleRubrique);
  407.             // set the owning side to null (unless already changed)
  408.             if ($modeleRubrique->getTemplate() === $this) {
  409.                 $modeleRubrique->setTemplate(null);
  410.             }
  411.         }
  412.         return $this;
  413.     }
  414.     /**
  415.      * @return Collection|EditionTemplateVariant[]
  416.      */
  417.     public function getVariants() : Collection
  418.     {
  419.         return $this->variants;
  420.     }
  421.     public function addVariant(EditionTemplateVariant $variant) : self
  422.     {
  423.         if (!$this->variants->contains($variant)) {
  424.             $this->variants[] = $variant;
  425.             $variant->setTemplate($this);
  426.         }
  427.         return $this;
  428.     }
  429.     public function removeVariant(EditionTemplateVariant $variant) : self
  430.     {
  431.         if ($this->variants->contains($variant)) {
  432.             $this->variants->removeElement($variant);
  433.             // set the owning side to null (unless already changed)
  434.             if ($variant->getTemplate() === $this) {
  435.                 $variant->setTemplate(null);
  436.             }
  437.         }
  438.         return $this;
  439.     }
  440.     public function getParams() : ?array
  441.     {
  442.         return $this->params;
  443.     }
  444.     public function setParams(?array $params) : self
  445.     {
  446.         $this->params $params;
  447.         return $this;
  448.     }
  449.     /**
  450.      * @return Collection|CustomCode[]
  451.      */
  452.     public function getCustomCodes () : Collection
  453.     {
  454.         return $this->customCodes;
  455.     }
  456.     public function addCustomCode (CustomCode $code) : self
  457.     {
  458.         if (!$this->customCodes->contains($code)) {
  459.             $this->customCodes[] = $code;
  460.         }
  461.         return $this;
  462.     }
  463.     public function removeCustomCode(CustomCode $code) : self
  464.     {
  465.         if ($this->customCodes->contains($code)) {
  466.             $this->customCodes->removeElement($code);
  467.         }
  468.         return $this;
  469.     }
  470. }