<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\ModelExportHistoryRepository;
use Doctrine\DBAL\Types\Types;
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=ModelExportHistoryRepository::class)
*
* @Vich\Uploadable
*/
class ModelExportHistory
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $name = null;
/**
* @ORM\Column(name="group_export", type="text", nullable=true)
*/
private ?string $groupExport = null;
/**
* @ORM\Column(name="surveys_years", type="text", nullable=true)
*/
private ?string $surveysYears = null;
/**
* @ORM\Column(name="filename", type="string", length=255, nullable=true)
*
* @var string
*/
private $filename;
/**
* @Vich\UploadableField(mapping="model_export_history", fileNameProperty="filename")
*/
#[Assert\File(mimeTypes: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], mimeTypesMessage: 'Mettre uniquement des fichiers de type tableur')]
private ?File $file = null;
/**
* @ORM\Column(name="updatedAt", type="datetime", nullable=true)
*
* @Gedmo\Timestampable(on="update")
*
* @var \DateTime
*/
private $updatedAt;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getGroupExport(): ?string
{
return $this->groupExport;
}
public function setGroupExport(?string $groupExport): static
{
$this->groupExport = $groupExport;
return $this;
}
public function getSurveysYears(): ?string
{
return $this->surveysYears;
}
public function setSurveysYears(?string $surveysYears): static
{
$this->surveysYears = $surveysYears;
return $this;
}
public function getFilename(): ?string
{
return $this->filename;
}
public function setFilename(?string $filename): static
{
$this->filename = $filename;
return $this;
}
public function getFile(): ?File
{
return $this->file;
}
public function setFile(?File $file): static
{
$this->file = $file;
if ($file instanceof File) {
$this->updatedAt = new \DateTime('now');
}
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
}