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