<?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\EditionModeleRepository")
*/
class EditionModele
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du modele"})
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplate", inversedBy="modeles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="template_id", referencedColumnName="id")
* })
*/
private $template;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplateVariant", inversedBy="modeles", cascade={"persist"})
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="variant_id", referencedColumnName="id")
* })
*/
private $variant;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubrique", mappedBy="modele", cascade={"persist","remove"}, orphanRemoval=true)
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $rubriques;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModeleParameter", mappedBy="modele", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $parameters;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="editionModeles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="editionModeles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
/**
* @ORM\OneToMany(targetEntity="App\Entity\EditionPlanification", mappedBy="modele")
*/
private $planifications;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $customCss;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": false})
*/
private $isInBookletMode;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": false})
*/
private $isInAnnonceMode;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EditionTemplatePied", inversedBy="modeles", cascade={"persist"})
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="pied_id", referencedColumnName="id")
* })
*/
private ?EditionTemplatePied $pied;
public function __construct()
{
$this->rubriques = new ArrayCollection();
$this->parameters = new ArrayCollection();
$this->planifications = 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 getCreatedAt() : ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt) : self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt() : ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState() : ?int
{
return $this->state;
}
public function setState(?int $state) : self
{
$this->state = $state;
return $this;
}
public function getTemplate() : ?EditionTemplate
{
return $this->template;
}
public function setTemplate(?EditionTemplate $template) : self
{
$this->template = $template;
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->setModele($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->getModele() === $this) {
$rubrique->setModele(null);
}
}
return $this;
}
/**
* @return Collection|EditionModeleParameter[]
*/
public function getParameters() : Collection
{
return $this->parameters;
}
public function addParameter(EditionModeleParameter $parameter) : self
{
if (!$this->parameters->contains($parameter)) {
$this->parameters[] = $parameter;
$parameter->setModele($this);
}
return $this;
}
public function removeParameter(EditionModeleParameter $parameter) : self
{
if ($this->parameters->contains($parameter)) {
$this->parameters->removeElement($parameter);
// set the owning side to null (unless already changed)
if ($parameter->getModele() === $this) {
$parameter->setModele(null);
}
}
return $this;
}
public function getOwner() : ?User
{
return $this->owner;
}
public function setOwner(?User $owner) : self
{
$this->owner = $owner;
return $this;
}
public function getEntity() : ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity) : self
{
$this->entity = $entity;
return $this;
}
public function getVariant() : ?EditionTemplateVariant
{
return $this->variant;
}
public function setVariant(?EditionTemplateVariant $variant) : self
{
$this->variant = $variant;
return $this;
}
/**
* @return Collection|EditionPlanification[]
*/
public function getPlanifications() : Collection
{
return $this->planifications;
}
public function addPlanification(EditionPlanification $planification) : self
{
if (!$this->planifications->contains($planification)) {
$this->planifications[] = $planification;
$planification->setModele($this);
}
return $this;
}
public function removePlanification(EditionPlanification $planification) : self
{
if ($this->planifications->contains($planification)) {
$this->planifications->removeElement($planification);
// set the owning side to null (unless already changed)
if ($planification->getModele() === $this) {
$planification->setModele(null);
}
}
return $this;
}
public function getCustomCss() : ?string
{
return $this->customCss;
}
public function setCustomCss(?string $customCss) : self
{
$this->customCss = $customCss;
return $this;
}
public function getIsInBookletMode() : ?bool
{
return $this->isInBookletMode;
}
public function setIsInBookletMode(?bool $isInBookletMode) : self
{
$this->isInBookletMode = $isInBookletMode;
return $this;
}
public function getIsInAnnonceMode(): ?bool
{
return $this->isInAnnonceMode;
}
public function setIsInAnnonceMode(?bool $isInAnnonceMode): self
{
$this->isInAnnonceMode = $isInAnnonceMode;
return $this;
}
public function getPied() : ?EditionTemplatePied
{
return $this->pied;
}
public function setPied(?EditionTemplatePied $pied) : self
{
$this->pied = $pied;
return $this;
}
}