src/Entity/Aviso.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\TipoAvisoEnum;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8. * @ORM\Entity
  9. * @ORM\Table(name="aviso")
  10. */
  11. class Aviso extends BaseEntity
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\Column(type="integer")
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\Column(type="string", nullable=true, enumType="App\Enum\TipoAvisoEnum")
  21. */
  22. private $tipo;
  23. /**
  24. * @ORM\Column(type="string", nullable=true)
  25. */
  26. private $asunto;
  27. /**
  28. * @ORM\Column(type="datetime", nullable=true)
  29. */
  30. private $fecha;
  31. /**
  32. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  33. */
  34. private $deletedAt;
  35. /**
  36. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  37. * @Gedmo\Timestampable(on="update")
  38. */
  39. private $updatedAt;
  40. /**
  41. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  42. * @Gedmo\Timestampable(on="create")
  43. */
  44. private $createdAt;
  45. /**
  46. * @ORM\ManyToOne(targetEntity=\App\Entity\PropietarioContenido::class, inversedBy="avisos")
  47. * @ORM\JoinColumn(name="propietario_contenido_id", referencedColumnName="id")
  48. */
  49. private $propietarioContenido;
  50. public function getId(): ?int
  51. {
  52. return $this->id;
  53. }
  54. public function setId($id)
  55. {
  56. $this->id = $id;
  57. return $this;
  58. }
  59. public function getTipo(): ?TipoAvisoEnum
  60. {
  61. return $this->tipo;// ? $this->tipo->label() : null;
  62. }
  63. public function setTipo(?TipoAvisoEnum $tipo): static
  64. {
  65. $this->tipo = $tipo;//TipoAvisoEnum::tryFrom($tipo);
  66. return $this;
  67. }
  68. public function getAsunto(): ?string
  69. {
  70. return $this->asunto;
  71. }
  72. public function setAsunto(?string $asunto): static
  73. {
  74. $this->asunto = $asunto;
  75. return $this;
  76. }
  77. public function getFecha(): ?\DateTimeInterface
  78. {
  79. return $this->fecha;
  80. }
  81. public function setFecha(?\DateTimeInterface $fecha): static
  82. {
  83. $this->fecha = $fecha;
  84. return $this;
  85. }
  86. public function getDeletedAt(): ?\DateTimeInterface
  87. {
  88. return $this->deletedAt;
  89. }
  90. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  91. {
  92. $this->deletedAt = $deletedAt;
  93. return $this;
  94. }
  95. public function getUpdatedAt(): ?\DateTimeInterface
  96. {
  97. return $this->updatedAt;
  98. }
  99. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  100. {
  101. $this->updatedAt = $updatedAt;
  102. return $this;
  103. }
  104. public function getCreatedAt(): ?\DateTimeInterface
  105. {
  106. return $this->createdAt;
  107. }
  108. public function setCreatedAt(\DateTimeInterface $createdAt): static
  109. {
  110. $this->createdAt = $createdAt;
  111. return $this;
  112. }
  113. public function getPropietarioContenido(): ?PropietarioContenido
  114. {
  115. return $this->propietarioContenido;
  116. }
  117. public function setPropietarioContenido(?PropietarioContenido $propietarioContenido): static
  118. {
  119. $this->propietarioContenido = $propietarioContenido;
  120. return $this;
  121. }
  122. }