src/Entity/RegistroPolicial.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Uid\Uuid;
  7. /**
  8. * @ORM\Entity(repositoryClass="App\Repository\RegistroPolicialRepository")
  9. * @ORM\EntityListeners({"App\EntityListener\RegistroPolicial\CalcularIDPerseoListener", "App\EntityListener\RegistroPolicial\CalcularIDRegistroListener"})
  10. * @ORM\Table(name="registro_policial", schema="perseo")
  11. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12. */
  13. class RegistroPolicial
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\Column(type="uuid", unique=true)
  18. * @ORM\GeneratedValue(strategy="CUSTOM")
  19. * @ORM\CustomIdGenerator(class="doctrine.uuid_generator")
  20. */
  21. protected $id;
  22. /**
  23. * @ORM\Column(
  24. * type="string",
  25. * unique=true,
  26. * nullable=false,
  27. * name="id_perseo",
  28. * options={"comment":"Identificador de perseo"}
  29. * )
  30. */
  31. protected $IDperseo;
  32. /**
  33. * @ORM\Column(
  34. * type="string",
  35. * unique=true,
  36. * nullable=true,
  37. * name="id_registro_policial",
  38. * options={"comment":"Su estructura será AA/001 para compras y AA/001-G para gestión, donde se reiniciará cada año."}
  39. * )
  40. */
  41. private $IDregistroPolicial;
  42. /**
  43. * @ORM\Column(type="datetime", nullable=true, name="fecha_comunicacion")
  44. */
  45. private $fechaComunicacion;
  46. /**
  47. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  48. */
  49. protected $deletedAt;
  50. /**
  51. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  52. * @Gedmo\Timestampable(on="update")
  53. */
  54. protected $updatedAt;
  55. /**
  56. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  57. * @Gedmo\Timestampable(on="create")
  58. */
  59. protected $createdAt;
  60. /**
  61. * @ORM\OneToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="registroPolicial")
  62. * @ORM\JoinColumn(name="reloj_id", referencedColumnName="id", nullable=false, unique=true)
  63. */
  64. protected $reloj;
  65. public function getId(): ?Uuid
  66. {
  67. return $this->id;
  68. }
  69. public function getIDperseo(): ?string
  70. {
  71. return $this->IDperseo;
  72. }
  73. public function setIDperseo(string $IDperseo): self
  74. {
  75. $this->IDperseo = $IDperseo;
  76. return $this;
  77. }
  78. public function getDeletedAt(): ?\DateTimeInterface
  79. {
  80. return $this->deletedAt;
  81. }
  82. public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  83. {
  84. $this->deletedAt = $deletedAt;
  85. return $this;
  86. }
  87. public function getUpdatedAt(): ?\DateTimeInterface
  88. {
  89. return $this->updatedAt;
  90. }
  91. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  92. {
  93. $this->updatedAt = $updatedAt;
  94. return $this;
  95. }
  96. public function getCreatedAt(): ?\DateTimeInterface
  97. {
  98. return $this->createdAt;
  99. }
  100. public function setCreatedAt(\DateTimeInterface $createdAt): self
  101. {
  102. $this->createdAt = $createdAt;
  103. return $this;
  104. }
  105. public function getReloj(): ?Reloj
  106. {
  107. return $this->reloj;
  108. }
  109. public function setReloj(?Reloj $reloj): self
  110. {
  111. $this->reloj = $reloj;
  112. return $this;
  113. }
  114. public function getIDregistroPolicial(): ?string
  115. {
  116. return $this->IDregistroPolicial;
  117. }
  118. public function setIDregistroPolicial(string $IDregistroPolicial): static
  119. {
  120. $this->IDregistroPolicial = $IDregistroPolicial;
  121. return $this;
  122. }
  123. public function getFechaComunicacion(): ?\DateTimeInterface
  124. {
  125. return $this->fechaComunicacion;
  126. }
  127. public function setFechaComunicacion(?\DateTimeInterface $fechaComunicacion): static
  128. {
  129. $this->fechaComunicacion = $fechaComunicacion;
  130. return $this;
  131. }
  132. public function getTipo(): string
  133. {
  134. return '---';
  135. }
  136. public function getExportFechaComunicacion(): ?string
  137. {
  138. return $this->getFechaComunicacion()?->format('d/m/Y');
  139. }
  140. }