<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity (repositoryClass="App\Repository\EditionTemplateVariantRepository")
*/
class EditionTemplateVariant
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="variants")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $template;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la variante"})
*/
private $name;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $ordering;
/**
* @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin du template"})
*/
private $layoutPath;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Options pour la transformation WKHTMLToPDF"})
*/
private $htmlToPdfOptions;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
*/
private $params;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModele", mappedBy="variant", cascade={"persist"})
* @ORM\OrderBy({"name" = "ASC"})
*/
private $modeles;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte de la variante"})
*/
private $key;
public function __construct()
{
$this->modeles = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getName() : ?string
{
return $this->name;
}
public function setName(?string $name) : self
{
$this->name = $name;
return $this;
}
public function getLayoutPath() : ?string
{
return $this->layoutPath;
}
public function setLayoutPath(?string $layoutPath) : self
{
$this->layoutPath = $layoutPath;
return $this;
}
public function getHtmlToPdfOptions() : ?array
{
return $this->htmlToPdfOptions;
}
public function setHtmlToPdfOptions(?array $htmlToPdfOptions) : self
{
$this->htmlToPdfOptions = $htmlToPdfOptions;
return $this;
}
public function getTemplate() : ?EditionTemplate
{
return $this->template;
}
public function setTemplate(?EditionTemplate $template) : self
{
$this->template = $template;
return $this;
}
/**
* @return Collection|EditionModele[]
*/
public function getModeles() : Collection
{
return $this->modeles;
}
public function addModele(EditionModele $modele) : self
{
if (!$this->modeles->contains($modele)) {
$this->modeles[] = $modele;
$modele->setVariant($this);
}
return $this;
}
public function removeModele(EditionModele $modele) : self
{
if ($this->modeles->contains($modele)) {
$this->modeles->removeElement($modele);
// set the owning side to null (unless already changed)
if ($modele->getVariant() === $this) {
$modele->setVariant(null);
}
}
return $this;
}
public function getOrdering() : ?int
{
return $this->ordering;
}
public function setOrdering(?int $ordering) : self
{
$this->ordering = $ordering;
return $this;
}
public function getKey() : ?string
{
return $this->key;
}
public function setKey(?string $key) : self
{
$this->key = $key;
return $this;
}
public function getParams() : ?array
{
return $this->params;
}
public function setParams(?array $params) : self
{
$this->params = $params;
return $this;
}
}