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. public const TYPES_STRUCTURE = ['CSO', 'EVS'];
  19. /**
  20. * @ORM\Id
  21. *
  22. * @ORM\GeneratedValue
  23. *
  24. * @ORM\Column(type="integer")
  25. */
  26. private $id;
  27. /**
  28. * @ORM\Column(type="string", length=255, nullable=true)
  29. */
  30. private ?string $name = null;
  31. /**
  32. * @ORM\Column(name="group_export", type="text", nullable=true)
  33. */
  34. private ?string $groupExport = null;
  35. /**
  36. * @ORM\Column(name="surveys_years", type="text", nullable=true)
  37. */
  38. private ?string $surveysYears = null;
  39. /**
  40. * @ORM\Column(name="filename", type="string", length=255, nullable=true)
  41. *
  42. * @var string
  43. */
  44. private $filename;
  45. /**
  46. * @Vich\UploadableField(mapping="model_export_history", fileNameProperty="filename")
  47. */
  48. #[Assert\File(mimeTypes: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], mimeTypesMessage: 'Mettre uniquement des fichiers de type tableur')]
  49. private ?File $file = null;
  50. /**
  51. * @ORM\Column(name="type_structure", type="string", length=3, nullable=true)
  52. */
  53. private ?string $typeStructure = null;
  54. /**
  55. * @ORM\Column(name="updatedAt", type="datetime", nullable=true)
  56. *
  57. * @Gedmo\Timestampable(on="update")
  58. *
  59. * @var \DateTime
  60. */
  61. private $updatedAt;
  62. public function getId(): ?int
  63. {
  64. return $this->id;
  65. }
  66. public function getName(): ?string
  67. {
  68. return $this->name;
  69. }
  70. public function setName(?string $name): static
  71. {
  72. $this->name = $name;
  73. return $this;
  74. }
  75. public function getGroupExport(): ?string
  76. {
  77. return $this->groupExport;
  78. }
  79. public function setGroupExport(?string $groupExport): static
  80. {
  81. $this->groupExport = $groupExport;
  82. return $this;
  83. }
  84. public function getSurveysYears(): ?string
  85. {
  86. return $this->surveysYears;
  87. }
  88. public function setSurveysYears(?string $surveysYears): static
  89. {
  90. $this->surveysYears = $surveysYears;
  91. return $this;
  92. }
  93. public function getFilename(): ?string
  94. {
  95. return $this->filename;
  96. }
  97. public function setFilename(?string $filename): static
  98. {
  99. $this->filename = $filename;
  100. return $this;
  101. }
  102. public function getFile(): ?File
  103. {
  104. return $this->file;
  105. }
  106. public function setFile(?File $file): static
  107. {
  108. $this->file = $file;
  109. if ($file instanceof File) {
  110. $this->updatedAt = new \DateTime('now');
  111. }
  112. return $this;
  113. }
  114. public function getTypeStructure(): ?string
  115. {
  116. return $this->typeStructure;
  117. }
  118. public function setTypeStructure(?string $typeStructure): static
  119. {
  120. $this->typeStructure = $typeStructure;
  121. return $this;
  122. }
  123. public function getUpdatedAt(): ?\DateTimeInterface
  124. {
  125. return $this->updatedAt;
  126. }
  127. public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  128. {
  129. $this->updatedAt = $updatedAt;
  130. return $this;
  131. }
  132. }