<?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\EditionCoverTemplateParameterGroupRepository")
*/
class EditionCoverTemplateParameterGroup
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du groupe"})
*/
private ?string $name;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $ordering;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionCoverTemplate", inversedBy="parameterGroups")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private ?EditionCoverTemplate $template;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Indique pour quoi est le groupe : ici toujours COVER", "default":"COVER"})
*/
private ?string $isFor;
/**
* @var Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionCoverTemplateParameter", mappedBy="group", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $parameters;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Clé texte du groupe des parametres"})
*/
private ?string $key;
public function __construct()
{
$this->parameters = 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 getOrdering() : ?int
{
return $this->ordering;
}
public function setOrdering(?int $ordering) : self
{
$this->ordering = $ordering;
return $this;
}
public function getIsFor() : ?string
{
return $this->isFor;
}
public function setIsFor(?string $isFor) : self
{
$this->isFor = $isFor;
return $this;
}
public function getTemplate() : ?EditionCoverTemplate
{
return $this->template;
}
public function setTemplate(?EditionCoverTemplate $template) : self
{
$this->template = $template;
return $this;
}
/**
* @return Collection|EditionCoverTemplateParameter[]
*/
public function getParameters() : Collection
{
return $this->parameters;
}
public function addParameter(EditionCoverTemplateParameter $parameter) : self
{
if (!$this->parameters->contains($parameter)) {
$this->parameters[] = $parameter;
$parameter->setGroup($this);
}
return $this;
}
public function removeParameter(EditionCoverTemplateParameter $parameter) : self
{
if ($this->parameters->contains($parameter)) {
$this->parameters->removeElement($parameter);
// set the owning side to null (unless already changed)
if ($parameter->getGroup() === $this) {
$parameter->setGroup(null);
}
}
return $this;
}
public function getKey() : ?string
{
return $this->key;
}
public function setKey(?string $key) : self
{
$this->key = $key;
return $this;
}
}