src/Entity/ParticipantesGrupo.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  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 Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
  11. use App\Enum\ParticipantesGrupoEstado;
  12. /**
  13. * @ORM\Entity
  14. * @ORM\Table(
  15. * name="participantes_grupo",
  16. * indexes={
  17. * @ORM\Index(name="idx_participantes_grupo_grupo", columns={"grupo_id"}),
  18. * @ORM\Index(name="idx_participantes_etp", columns={"entidad_tiene_participantes_id"}),
  19. * @ORM\Index(name="idx_participantes_deleted_at", columns={"deleted_at"})
  20. * }
  21. * )
  22. */
  23. #[Uploadable]
  24. class ParticipantesGrupo extends \App\Entity\BaseEntity
  25. {
  26. /**
  27. * @ORM\Id
  28. * @ORM\Column(type="integer")
  29. * @ORM\GeneratedValue(strategy="AUTO")
  30. */
  31. private $id;
  32. /**
  33. * @ORM\Column(type="string", nullable=true, name="id_externo")
  34. */
  35. private $idExterno;
  36. /**
  37. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  38. * @Gedmo\Timestampable(on="create")
  39. */
  40. private $createdAt;
  41. /**
  42. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  43. * @Gedmo\Timestampable(on="update")
  44. */
  45. private $updatedAt;
  46. /**
  47. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  48. */
  49. private $deletedAt;
  50. /**
  51. * @ORM\ManyToOne(targetEntity=\App\Entity\Grupo::class, inversedBy="participantesGrupos")
  52. * @ORM\JoinColumn(name="grupo_id", referencedColumnName="id")
  53. */
  54. private $grupo;
  55. /**
  56. * @ORM\Column(type="datetime", nullable=true, name="fecha_inscripcion")
  57. */
  58. private $fechaInscripcion;
  59. /**
  60. * @ORM\Column(type="string", nullable=true)
  61. */
  62. private ?string $estado = 'PREINSCRITO';
  63. /**
  64. * @ORM\Column(type="text", nullable=true)
  65. */
  66. private ?string $motivoRechazo = null;
  67. /**
  68. * @ORM\Column(type="boolean", nullable=true, name="es_rechazo_definitivo")
  69. */
  70. private ?bool $esRechazoDefinitivo = false;
  71. /**
  72. * @ORM\Column(type="string", length=255, nullable=true, name="motivo_baja")
  73. */
  74. private ?string $motivoBaja = null;
  75. /**
  76. * @ORM\Column(type="text", nullable=true, name="detalles_motivo_baja")
  77. */
  78. private ?string $detallesMotivoBaja = null;
  79. public function getEstado(): ?string
  80. {
  81. return $this->estado;
  82. }
  83. public function setEstado(?string $estado): self
  84. {
  85. $this->estado = $estado;
  86. return $this;
  87. }
  88. /**
  89. * @ORM\Column(type="integer", nullable=true, name="id_formulario_respuesta")
  90. */
  91. private $idFormularioRespuesta;
  92. /**
  93. * @ORM\Column(type="string", nullable=true, name="ruta_pdf_firmado")
  94. */
  95. private $rutaPdfFirmado;
  96. /**
  97. * @ORM\Column(type="string", nullable=true, name="ruta_pdf_certificado")
  98. */
  99. private $rutaPdfCertificado;
  100. /**
  101. * @var File|null
  102. */
  103. #[Vich\UploadableField(mapping: 'participantes_grupo_pdf', fileNameProperty: 'rutaPdfFirmado')]
  104. private $pdfFile;
  105. /**
  106. * @var File|null
  107. */
  108. #[Vich\UploadableField(mapping: 'participantes_grupo_certificado_pdf', fileNameProperty: 'rutaPdfCertificado')]
  109. private $pdfCertificadoFile;
  110. /**
  111. * Firma electrónica en formato XAdES-T codificada en base64
  112. * @ORM\Column(type="text", nullable=true, name="firma_xml")
  113. */
  114. private $firmaXml;
  115. /**
  116. * @ORM\OneToOne(targetEntity=\App\Entity\ParticipanteGrupoDetalle::class, inversedBy="participantesGrupos")
  117. * @ORM\JoinColumn(name="entidad_tiene_participantes_id", referencedColumnName="id", unique=true)
  118. */
  119. private $participanteGrupoDetalle;
  120. /**
  121. * @ORM\OneToMany(targetEntity=\App\Entity\Cuestionario::class, mappedBy="participantesGrupo")
  122. */
  123. private $cuestionarios;
  124. public function __construct()
  125. {
  126. $this->cuestionarios = new ArrayCollection();
  127. }
  128. public function getId(): ?int
  129. {
  130. return $this->id;
  131. }
  132. public function setId($id)
  133. {
  134. $this->id = $id;
  135. return $this;
  136. }
  137. public function getIdExterno(): ?string
  138. {
  139. return $this->idExterno;
  140. }
  141. public function setIdExterno(?string $idExterno): static
  142. {
  143. $this->idExterno = $idExterno;
  144. return $this;
  145. }
  146. public function getCreatedAt(): ?\DateTimeInterface
  147. {
  148. return $this->createdAt;
  149. }
  150. public function setCreatedAt(\DateTimeInterface $createdAt): static
  151. {
  152. $this->createdAt = $createdAt;
  153. return $this;
  154. }
  155. public function getUpdatedAt(): ?\DateTimeInterface
  156. {
  157. return $this->updatedAt;
  158. }
  159. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  160. {
  161. $this->updatedAt = $updatedAt;
  162. return $this;
  163. }
  164. public function getDeletedAt(): ?\DateTimeInterface
  165. {
  166. return $this->deletedAt;
  167. }
  168. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  169. {
  170. $this->deletedAt = $deletedAt;
  171. return $this;
  172. }
  173. public function getGrupo(): ?Grupo
  174. {
  175. return $this->grupo;
  176. }
  177. public function setGrupo(?Grupo $grupo): static
  178. {
  179. $this->grupo = $grupo;
  180. return $this;
  181. }
  182. public function getFechaInscripcion(): ?\DateTimeInterface
  183. {
  184. return $this->fechaInscripcion;
  185. }
  186. public function setFechaInscripcion(?\DateTimeInterface $fechaInscripcion): static
  187. {
  188. $this->fechaInscripcion = $fechaInscripcion;
  189. return $this;
  190. }
  191. public function getIdFormularioRespuesta(): ?int
  192. {
  193. return $this->idFormularioRespuesta;
  194. }
  195. public function setIdFormularioRespuesta(?int $idFormularioRespuesta): static
  196. {
  197. $this->idFormularioRespuesta = $idFormularioRespuesta;
  198. return $this;
  199. }
  200. public function getRutaPdfFirmado(): ?string
  201. {
  202. return $this->rutaPdfFirmado;
  203. }
  204. public function setRutaPdfFirmado(?string $rutaPdfFirmado): static
  205. {
  206. $this->rutaPdfFirmado = $rutaPdfFirmado;
  207. return $this;
  208. }
  209. /**
  210. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pdfFile
  211. */
  212. public function setPdfFile(?File $pdfFile = null): void
  213. {
  214. $this->pdfFile = $pdfFile;
  215. if (null !== $pdfFile) {
  216. // Necesario para que Doctrine detecte el cambio si solo se ha cambiado el archivo
  217. $this->updatedAt = new \DateTime();
  218. }
  219. }
  220. public function getPdfFile(): ?File
  221. {
  222. return $this->pdfFile;
  223. }
  224. public function getRutaPdfCertificado(): ?string
  225. {
  226. return $this->rutaPdfCertificado;
  227. }
  228. public function setRutaPdfCertificado(?string $rutaPdfCertificado): static
  229. {
  230. $this->rutaPdfCertificado = $rutaPdfCertificado;
  231. return $this;
  232. }
  233. /**
  234. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pdfCertificadoFile
  235. */
  236. public function setPdfCertificadoFile(?File $pdfCertificadoFile = null): void
  237. {
  238. $this->pdfCertificadoFile = $pdfCertificadoFile;
  239. if (null !== $pdfCertificadoFile) {
  240. // Necesario para que Doctrine detecte el cambio si solo se ha cambiado el archivo
  241. $this->updatedAt = new \DateTime();
  242. }
  243. }
  244. public function getPdfCertificadoFile(): ?File
  245. {
  246. return $this->pdfCertificadoFile;
  247. }
  248. public function getFirmaXml(): ?string
  249. {
  250. return $this->firmaXml;
  251. }
  252. public function setFirmaXml(?string $firmaXml): static
  253. {
  254. $this->firmaXml = $firmaXml;
  255. return $this;
  256. }
  257. public function getParticipanteGrupoDetalle(): ?ParticipanteGrupoDetalle
  258. {
  259. return $this->participanteGrupoDetalle;
  260. }
  261. public function setParticipanteGrupoDetalle(?ParticipanteGrupoDetalle $participanteGrupoDetalle): static
  262. {
  263. $this->participanteGrupoDetalle = $participanteGrupoDetalle;
  264. return $this;
  265. }
  266. public function getMotivoRechazo(): ?string
  267. {
  268. return $this->motivoRechazo;
  269. }
  270. public function setMotivoRechazo(?string $motivoRechazo): self
  271. {
  272. $this->motivoRechazo = $motivoRechazo;
  273. return $this;
  274. }
  275. public function isEsRechazoDefinitivo(): ?bool
  276. {
  277. return $this->esRechazoDefinitivo;
  278. }
  279. public function setEsRechazoDefinitivo(?bool $esRechazoDefinitivo): self
  280. {
  281. $this->esRechazoDefinitivo = $esRechazoDefinitivo;
  282. return $this;
  283. }
  284. /**
  285. * @return Collection<int, Cuestionario>
  286. */
  287. public function getCuestionarios(): Collection
  288. {
  289. return $this->cuestionarios;
  290. }
  291. public function addCuestionario(Cuestionario $cuestionario): static
  292. {
  293. if (!$this->cuestionarios->contains($cuestionario)) {
  294. $this->cuestionarios->add($cuestionario);
  295. $cuestionario->setParticipantesGrupo($this);
  296. }
  297. return $this;
  298. }
  299. public function removeCuestionario(Cuestionario $cuestionario): static
  300. {
  301. if ($this->cuestionarios->removeElement($cuestionario)) {
  302. // set the owning side to null (unless already changed)
  303. if ($cuestionario->getParticipantesGrupo() === $this) {
  304. $cuestionario->setParticipantesGrupo(null);
  305. }
  306. }
  307. return $this;
  308. }
  309. public function getMotivoBaja(): ?string
  310. {
  311. return $this->motivoBaja;
  312. }
  313. public function setMotivoBaja(?string $motivoBaja): self
  314. {
  315. $this->motivoBaja = $motivoBaja;
  316. return $this;
  317. }
  318. public function getDetallesMotivoBaja(): ?string
  319. {
  320. return $this->detallesMotivoBaja;
  321. }
  322. public function setDetallesMotivoBaja(?string $detallesMotivoBaja): self
  323. {
  324. $this->detallesMotivoBaja = $detallesMotivoBaja;
  325. return $this;
  326. }
  327. }