src/Entity/EditionTemplateVariant.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\EditionTemplateVariantRepository")
  8.  */
  9. class EditionTemplateVariant
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="variants")
  19.      * @ORM\JoinColumns({
  20.      *   @ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")
  21.      * })
  22.      */
  23.     private $template;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la variante"})
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\Column(type="integer", nullable=true)
  30.      */
  31.     private $ordering;
  32.     /**
  33.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du template"})
  34.      */
  35.     private $layoutPath;
  36.     /**
  37.      * @ORM\Column(type="json", nullable=true, options={"comment":"Options pour la transformation WKHTMLToPDF"})
  38.      */
  39.     private $htmlToPdfOptions;
  40.     /**
  41.      * @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
  42.      */
  43.     private $params;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModele", mappedBy="variant", cascade={"persist"})
  48.      * @ORM\OrderBy({"name" = "ASC"})
  49.      */
  50.     private $modeles;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"ClĂ© texte de la variante"})
  53.      */
  54.     private $key;
  55.     public function __construct()
  56.     {
  57.         $this->modeles = new ArrayCollection();
  58.     }
  59.     public function getId() : ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getName() : ?string
  64.     {
  65.         return $this->name;
  66.     }
  67.     public function setName(?string $name) : self
  68.     {
  69.         $this->name $name;
  70.         return $this;
  71.     }
  72.     public function getLayoutPath() : ?string
  73.     {
  74.         return $this->layoutPath;
  75.     }
  76.     public function setLayoutPath(?string $layoutPath) : self
  77.     {
  78.         $this->layoutPath $layoutPath;
  79.         return $this;
  80.     }
  81.     public function getHtmlToPdfOptions() : ?array
  82.     {
  83.         return $this->htmlToPdfOptions;
  84.     }
  85.     public function setHtmlToPdfOptions(?array $htmlToPdfOptions) : self
  86.     {
  87.         $this->htmlToPdfOptions $htmlToPdfOptions;
  88.         return $this;
  89.     }
  90.     public function getTemplate() : ?EditionTemplate
  91.     {
  92.         return $this->template;
  93.     }
  94.     public function setTemplate(?EditionTemplate $template) : self
  95.     {
  96.         $this->template $template;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection|EditionModele[]
  101.      */
  102.     public function getModeles() : Collection
  103.     {
  104.         return $this->modeles;
  105.     }
  106.     public function addModele(EditionModele $modele) : self
  107.     {
  108.         if (!$this->modeles->contains($modele)) {
  109.             $this->modeles[] = $modele;
  110.             $modele->setVariant($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeModele(EditionModele $modele) : self
  115.     {
  116.         if ($this->modeles->contains($modele)) {
  117.             $this->modeles->removeElement($modele);
  118.             // set the owning side to null (unless already changed)
  119.             if ($modele->getVariant() === $this) {
  120.                 $modele->setVariant(null);
  121.             }
  122.         }
  123.         return $this;
  124.     }
  125.     public function getOrdering() : ?int
  126.     {
  127.         return $this->ordering;
  128.     }
  129.     public function setOrdering(?int $ordering) : self
  130.     {
  131.         $this->ordering $ordering;
  132.         return $this;
  133.     }
  134.     public function getKey() : ?string
  135.     {
  136.         return $this->key;
  137.     }
  138.     public function setKey(?string $key) : self
  139.     {
  140.         $this->key $key;
  141.         return $this;
  142.     }
  143.     public function getParams() : ?array
  144.     {
  145.         return $this->params;
  146.     }
  147.     public function setParams(?array $params) : self
  148.     {
  149.         $this->params $params;
  150.         return $this;
  151.     }
  152. }