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