src/Entity/ModelExportHistory.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\ModelExportHistoryRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. /**
  12. * @ORM\Entity(repositoryClass=ModelExportHistoryRepository::class)
  13. *
  14. * @Vich\Uploadable
  15. */
  16. class ModelExportHistory
  17. {
  18. /**
  19. * @ORM\Id
  20. *
  21. * @ORM\GeneratedValue
  22. *
  23. * @ORM\Column(type="integer")
  24. */
  25. private $id;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=true)
  28. */
  29. private ?string $name = null;
  30. /**
  31. * @ORM\Column(name="group_export", type="text", nullable=true)
  32. */
  33. private ?string $groupExport = null;
  34. /**
  35. * @ORM\Column(name="surveys_years", type="text", nullable=true)
  36. */
  37. private ?string $surveysYears = null;
  38. /**
  39. * @ORM\Column(name="filename", type="string", length=255, nullable=true)
  40. *
  41. * @var string
  42. */
  43. private $filename;
  44. /**
  45. * @Vich\UploadableField(mapping="model_export_history", fileNameProperty="filename")
  46. */
  47. #[Assert\File(mimeTypes: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], mimeTypesMessage: 'Mettre uniquement des fichiers de type tableur')]
  48. private ?File $file = null;
  49. /**
  50. * @ORM\Column(name="updatedAt", type="datetime", nullable=true)
  51. *
  52. * @Gedmo\Timestampable(on="update")
  53. *
  54. * @var \DateTime
  55. */
  56. private $updatedAt;
  57. public function getId(): ?int
  58. {
  59. return $this->id;
  60. }
  61. public function getName(): ?string
  62. {
  63. return $this->name;
  64. }
  65. public function setName(?string $name): static
  66. {
  67. $this->name = $name;
  68. return $this;
  69. }
  70. public function getGroupExport(): ?string
  71. {
  72. return $this->groupExport;
  73. }
  74. public function setGroupExport(?string $groupExport): static
  75. {
  76. $this->groupExport = $groupExport;
  77. return $this;
  78. }
  79. public function getSurveysYears(): ?string
  80. {
  81. return $this->surveysYears;
  82. }
  83. public function setSurveysYears(?string $surveysYears): static
  84. {
  85. $this->surveysYears = $surveysYears;
  86. return $this;
  87. }
  88. public function getFilename(): ?string
  89. {
  90. return $this->filename;
  91. }
  92. public function setFilename(?string $filename): static
  93. {
  94. $this->filename = $filename;
  95. return $this;
  96. }
  97. public function getFile(): ?File
  98. {
  99. return $this->file;
  100. }
  101. public function setFile(?File $file): static
  102. {
  103. $this->file = $file;
  104. if ($file instanceof File) {
  105. $this->updatedAt = new \DateTime('now');
  106. }
  107. return $this;
  108. }
  109. public function getUpdatedAt(): ?\DateTimeInterface
  110. {
  111. return $this->updatedAt;
  112. }
  113. public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  114. {
  115. $this->updatedAt = $updatedAt;
  116. return $this;
  117. }
  118. }