<?php
namespace App\Entity;
use App\Repository\TemplateRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TemplateRepository::class)]
class Template
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\OneToMany(mappedBy: 'template', targetEntity: Document::class)]
private Collection $documents;
#[ORM\Column(type: Types::TEXT)]
private ?string $entete = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $pied = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $css = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $css_compile = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date_creation = null;
public function __construct()
{
$this->documents = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): static
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->setTemplate($this);
}
return $this;
}
public function removeDocument(Document $document): static
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getTemplate() === $this) {
$document->setTemplate(null);
}
}
return $this;
}
public function getEntete(): ?string
{
return $this->entete;
}
public function setEntete(string $entete): static
{
$this->entete = $entete;
return $this;
}
public function getPied(): ?string
{
return $this->pied;
}
public function setPied(string $pied): static
{
$this->pied = $pied;
return $this;
}
public function getCss(): ?string
{
return $this->css;
}
public function setCss(string $css): static
{
$this->css = $css;
return $this;
}
public function getCssCompile(): ?string
{
return $this->css_compile;
}
public function setCssCompile(string $css_compile): static
{
$this->css_compile = $css_compile;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(?\DateTimeInterface $date_creation): static
{
$this->date_creation = $date_creation;
return $this;
}
}