src/Entity/PlantillaContrato.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10. * @ORM\Entity(repositoryClass="App\Repository\PlantillaContratoRepository")
  11. * @ORM\Table(name="plantilla_contrato", schema="perseo")
  12. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  13. * @Vich\Uploadable
  14. */
  15. class PlantillaContrato extends PlantillaAbstract
  16. {
  17. /**
  18. * @ORM\Column(type="string", nullable=true)
  19. */
  20. private $header;
  21. /**
  22. * @Vich\UploadableField(mapping="plantillas", fileNameProperty="header")
  23. * @var File
  24. */
  25. private $headerFile;
  26. /**
  27. * @ORM\Column(type="string", nullable=true)
  28. */
  29. private $footer;
  30. /**
  31. * @Vich\UploadableField(mapping="plantillas", fileNameProperty="footer")
  32. * @var File
  33. */
  34. private $footerFile;
  35. /**
  36. * @ORM\Column(type="string", nullable=true)
  37. */
  38. private $template;
  39. /**
  40. * @Assert\File(
  41. * mimeTypes={
  42. * "application/vnd.oasis.opendocument.text",
  43. * "application/vnd.oasis.opendocument.spreadsheet",
  44. * }
  45. * )
  46. * @Vich\UploadableField(mapping="plantillas", fileNameProperty="template")
  47. * @var File
  48. */
  49. private $templateFile;
  50. public function getHeader(): ?string
  51. {
  52. return $this->header;
  53. }
  54. public function setHeader(?string $header): static
  55. {
  56. $this->header = $header;
  57. return $this;
  58. }
  59. public function getFooter(): ?string
  60. {
  61. return $this->footer;
  62. }
  63. public function setFooter(?string $footer): static
  64. {
  65. $this->footer = $footer;
  66. return $this;
  67. }
  68. public function getHeaderFile(): ?File
  69. {
  70. return $this->headerFile;
  71. }
  72. public function setHeaderFile(?File $headerFile): self
  73. {
  74. $this->headerFile = $headerFile;
  75. if ($headerFile) {
  76. // if 'updatedAt' is not defined in your entity, use another property
  77. $this->setUpdatedAt(new DateTime('now'));
  78. }
  79. return $this;
  80. }
  81. public function getFooterFile(): ?File
  82. {
  83. return $this->footerFile;
  84. }
  85. public function setFooterFile(?File $footerFile): self
  86. {
  87. $this->footerFile = $footerFile;
  88. if ($footerFile) {
  89. // if 'updatedAt' is not defined in your entity, use another property
  90. $this->setUpdatedAt(new DateTime('now'));
  91. }
  92. return $this;
  93. }
  94. public function getTemplate(): ?string
  95. {
  96. return $this->template;
  97. }
  98. public function setTemplate(?string $template): static
  99. {
  100. $this->template = $template;
  101. return $this;
  102. }
  103. public function getTemplateFile(): ?File
  104. {
  105. return $this->templateFile;
  106. }
  107. public function setTemplateFile(?File $templateFile): self
  108. {
  109. $this->templateFile = $templateFile;
  110. if ($templateFile) {
  111. // if 'updatedAt' is not defined in your entity, use another property
  112. $this->setUpdatedAt(new DateTime('now'));
  113. }
  114. return $this;
  115. }
  116. }