<?php
namespace App\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\PlantillaContratoRepository")
* @ORM\Table(name="plantilla_contrato", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
* @Vich\Uploadable
*/
class PlantillaContrato extends PlantillaAbstract
{
/**
* @ORM\Column(type="string", nullable=true)
*/
private $header;
/**
* @Vich\UploadableField(mapping="plantillas", fileNameProperty="header")
* @var File
*/
private $headerFile;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $footer;
/**
* @Vich\UploadableField(mapping="plantillas", fileNameProperty="footer")
* @var File
*/
private $footerFile;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $template;
/**
* @Assert\File(
* mimeTypes={
* "application/vnd.oasis.opendocument.text",
* "application/vnd.oasis.opendocument.spreadsheet",
* }
* )
* @Vich\UploadableField(mapping="plantillas", fileNameProperty="template")
* @var File
*/
private $templateFile;
public function getHeader(): ?string
{
return $this->header;
}
public function setHeader(?string $header): static
{
$this->header = $header;
return $this;
}
public function getFooter(): ?string
{
return $this->footer;
}
public function setFooter(?string $footer): static
{
$this->footer = $footer;
return $this;
}
public function getHeaderFile(): ?File
{
return $this->headerFile;
}
public function setHeaderFile(?File $headerFile): self
{
$this->headerFile = $headerFile;
if ($headerFile) {
// if 'updatedAt' is not defined in your entity, use another property
$this->setUpdatedAt(new DateTime('now'));
}
return $this;
}
public function getFooterFile(): ?File
{
return $this->footerFile;
}
public function setFooterFile(?File $footerFile): self
{
$this->footerFile = $footerFile;
if ($footerFile) {
// if 'updatedAt' is not defined in your entity, use another property
$this->setUpdatedAt(new DateTime('now'));
}
return $this;
}
public function getTemplate(): ?string
{
return $this->template;
}
public function setTemplate(?string $template): static
{
$this->template = $template;
return $this;
}
public function getTemplateFile(): ?File
{
return $this->templateFile;
}
public function setTemplateFile(?File $templateFile): self
{
$this->templateFile = $templateFile;
if ($templateFile) {
// if 'updatedAt' is not defined in your entity, use another property
$this->setUpdatedAt(new DateTime('now'));
}
return $this;
}
}