<?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\EditionContentsPageTemplateParameterRepository")
*/
class EditionContentsPageTemplateParameter
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé du parametre"})
*/
private $label;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du parametre"})
*/
private $key;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du type de paramètre"})
*/
private $type;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du groupe"})
*/
private $defaultValue;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $ordering;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $helpText;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"options si on choisit une liste"})
*/
private $options;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionContentsPageTemplateParameterGroup", inversedBy="parameters")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="group_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $group;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModeleContentsRubriqueParameter", mappedBy="templateParameter", cascade={"persist"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $rubriqueParameters;
public function __construct()
{
$this->rubriqueParameters = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getLabel() : ?string
{
return $this->label;
}
public function setLabel(?string $label) : self
{
$this->label = $label;
return $this;
}
public function getKey() : ?string
{
return $this->key;
}
public function setKey(?string $key) : self
{
$this->key = $key;
return $this;
}
public function getType() : ?string
{
return $this->type;
}
public function setType(?string $type) : self
{
$this->type = $type;
return $this;
}
public function getDefaultValue() : ?string
{
return $this->defaultValue;
}
public function setDefaultValue(?string $defaultValue) : self
{
$this->defaultValue = $defaultValue;
return $this;
}
public function getOrdering() : ?int
{
return $this->ordering;
}
public function setOrdering(?int $ordering) : self
{
$this->ordering = $ordering;
return $this;
}
public function getGroup() : ?EditionContentsPageTemplateParameterGroup
{
return $this->group;
}
public function setGroup(?EditionContentsPageTemplateParameterGroup $group) : self
{
$this->group = $group;
return $this;
}
/**
* @return Collection|EditionModeleContentsRubriqueParameter[]
*/
public function getRubriqueParameters() : Collection
{
return $this->rubriqueParameters;
}
public function addRubriqueParameter(EditionModeleContentsRubriqueParameter $rubriqueParameter) : self
{
if (!$this->rubriqueParameters->contains($rubriqueParameter)) {
$this->rubriqueParameters[] = $rubriqueParameter;
$rubriqueParameter->setTemplateParameter($this);
}
return $this;
}
public function removeRubriqueParameter(EditionModeleContentsRubriqueParameter $rubriqueParameter) : self
{
if ($this->rubriqueParameters->contains($rubriqueParameter)) {
$this->rubriqueParameters->removeElement($rubriqueParameter);
// set the owning side to null (unless already changed)
if ($rubriqueParameter->getTemplateParameter() === $this) {
$rubriqueParameter->setTemplateParameter(null);
}
}
return $this;
}
public function getHelpText() : ?string
{
return $this->helpText;
}
public function setHelpText(?string $helpText) : self
{
$this->helpText = $helpText;
return $this;
}
public function getOptions() : ?array
{
return $this->options;
}
public function setOptions(?array $options) : self
{
$this->options = $options;
return $this;
}
}