<?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\EditionCoverTemplateRepository")
*/
class EditionCoverTemplate
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="string", length=255, nullable=true) options={"comment":"Nom du template"})
*/
private ?string $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $gabaritName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $thumbnail;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $preview;
/**
* @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Chemin de la documentation"})
*/
private $documentation;
/**
* @ORM\Column(type="string", length=255, nullable=true) options={"comment":"Clé texte du template"})
*/
private ?string $key;
/**
* @ORM\Column(type="string", length=255, nullable=true) options={"comment":"Format du template"})
*/
private ?string $sizeKey;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Parametres techniques"})
*/
private ?array $params;
/**
* @var Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionCoverTemplateParameterGroup", mappedBy="template", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $parameterGroups;
/**
* @var Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubrique", mappedBy="cover", cascade={"persist"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $rubriques;
public function __construct()
{
$this->parameterGroups = new ArrayCollection();
$this->rubriques = 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 getDocumentation() : ?string
{
return $this->documentation;
}
public function setDocumentation(?string $documentation) : self
{
$this->documentation = $documentation;
return $this;
}
public function getGabaritName() : ?string
{
return $this->gabaritName;
}
public function setGabaritName(?string $gabaritName) : self
{
$this->gabaritName = $gabaritName;
return $this;
}
public function getThumbnail() : ?string
{
return $this->thumbnail;
}
public function setThumbnail(?string $thumbnail) : self
{
$this->thumbnail = $thumbnail;
return $this;
}
public function getPreview() : ?string
{
return $this->preview;
}
public function setPreview(?string $preview) : self
{
$this->preview = $preview;
return $this;
}
public function getKey() : ?string
{
return $this->key;
}
public function setKey(?string $key) : self
{
$this->key = $key;
return $this;
}
public function getSizeKey() : ?string
{
return $this->sizeKey;
}
public function setSizeKey(?string $sizeKey) : self
{
$this->sizeKey = $sizeKey;
return $this;
}
public function getParams() : ?array
{
return $this->params;
}
public function setParams(?array $params) : self
{
$this->params = $params;
return $this;
}
/**
* @return Collection|EditionCoverTemplateParameterGroup[]
*/
public function getParameterGroups() : Collection
{
return $this->parameterGroups;
}
public function addParameterGroup(EditionCoverTemplateParameterGroup $parameterGroup) : self
{
if (!$this->parameterGroups->contains($parameterGroup)) {
$this->parameterGroups[] = $parameterGroup;
$parameterGroup->setTemplate($this);
}
return $this;
}
public function removeParameterGroup(EditionCoverTemplateParameterGroup $parameterGroup) : self
{
if ($this->parameterGroups->contains($parameterGroup)) {
$this->parameterGroups->removeElement($parameterGroup);
// set the owning side to null (unless already changed)
if ($parameterGroup->getTemplate() === $this) {
$parameterGroup->setTemplate(null);
}
}
return $this;
}
/**
* @return Collection|EditionModeleRubrique[]
*/
public function getRubriques() : Collection
{
return $this->rubriques;
}
public function addRubrique(EditionModeleRubrique $rubrique) : self
{
if (!$this->rubriques->contains($rubrique)) {
$this->rubriques[] = $rubrique;
$rubrique->setCover($this);
}
return $this;
}
public function removeRubrique(EditionModeleRubrique $rubrique) : self
{
if ($this->rubriques->contains($rubrique)) {
$this->rubriques->removeElement($rubrique);
// set the owning side to null (unless already changed)
if ($rubrique->getCover() === $this) {
$rubrique->setCover(null);
}
}
return $this;
}
}