src/Core/Entity/Notificacion.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Core\Entity\Curso;
  4. use App\Core\Repository\NotificacionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=NotificacionRepository::class)
  8. */
  9. class Notificacion
  10. {
  11. CONST JSON_FIELDS = ['id', 'curso' => ['id', 'nombre'], 'titulo', 'texto', 'tipo','fecha', 'atributos', 'destinatario' => ['id'], 'vista', 'tituloEn', 'textoEn'];
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity=Curso::class, inversedBy="notificaciones")
  20. */
  21. private $curso;
  22. /**
  23. * @ORM\Column(type="string", length=100, nullable=false)
  24. */
  25. private $titulo;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=false)
  28. */
  29. private $texto;
  30. /**
  31. * @ORM\Column(type="string", length=50, nullable=false)
  32. * @var string
  33. */
  34. private $tipo;
  35. /**
  36. * @ORM\Column(type="datetime", nullable=false)
  37. * @var \DateTime
  38. */
  39. private $fecha;
  40. /**
  41. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="notificaciones")
  42. */
  43. private $destinatario;
  44. /**
  45. * @ORM\Column(type="json", nullable=true)
  46. */
  47. private $atributos = [];
  48. /**
  49. * @ORM\Column(type="boolean")
  50. */
  51. private $vista = false;
  52. /**
  53. * @ORM\Column(type="integer", nullable=true)
  54. */
  55. private $estado;
  56. /**
  57. * @ORM\Column(type="string", length=255, nullable=true)
  58. */
  59. private $titulo_en;
  60. /**
  61. * @ORM\Column(type="string", length=255, nullable=true)
  62. */
  63. private $texto_en;
  64. public function getId(): ?int
  65. {
  66. return $this->id;
  67. }
  68. public function getCurso(): ?Curso
  69. {
  70. return $this->curso;
  71. }
  72. public function setCurso(?Curso $curso): self
  73. {
  74. $this->curso = $curso;
  75. return $this;
  76. }
  77. public function getDestinatario(): ?User
  78. {
  79. return $this->destinatario;
  80. }
  81. public function setDestinatario(?User $user): self
  82. {
  83. $this->destinatario = $user;
  84. return $this;
  85. }
  86. public function getTexto(): ?string
  87. {
  88. return $this->texto;
  89. }
  90. public function setTexto(?string $texto): self
  91. {
  92. $this->texto = $texto;
  93. return $this;
  94. }
  95. public function getAtributos(): ?array
  96. {
  97. return $this->atributos;
  98. }
  99. public function setAtributos(?array $atributos): self
  100. {
  101. $this->atributos = $atributos;
  102. return $this;
  103. }
  104. public function getVista(): ?bool
  105. {
  106. return $this->vista;
  107. }
  108. public function setVista(bool $vista): self
  109. {
  110. $this->vista = $vista;
  111. return $this;
  112. }
  113. /**
  114. * @return string
  115. */
  116. public function getTipo(): string
  117. {
  118. return $this->tipo;
  119. }
  120. /**
  121. * @param string $tipo
  122. */
  123. public function setTipo(string $tipo): void
  124. {
  125. $this->tipo = $tipo;
  126. }
  127. /**
  128. * @return \DateTime
  129. */
  130. public function getFecha(): \DateTime
  131. {
  132. return $this->fecha;
  133. }
  134. /**
  135. * @param \DateTime $fecha
  136. */
  137. public function setFecha(\DateTime $fecha): void
  138. {
  139. $this->fecha = $fecha;
  140. }
  141. /**
  142. * @return string
  143. */
  144. public function getTitulo(): string
  145. {
  146. return $this->titulo;
  147. }
  148. /**
  149. * @param string $titulo
  150. */
  151. public function setTitulo(string $titulo): void
  152. {
  153. $this->titulo = $titulo;
  154. }
  155. /**
  156. * @return mixed
  157. */
  158. public function getEstado(): ?int
  159. {
  160. return $this->estado;
  161. }
  162. /**
  163. * @param mixed $estado
  164. */
  165. public function setEstado($estado): void
  166. {
  167. $this->estado = $estado;
  168. }
  169. public function getTituloEn(): ?string
  170. {
  171. return $this->titulo_en;
  172. }
  173. public function setTituloEn(?string $titulo_en): self
  174. {
  175. $this->titulo_en = $titulo_en;
  176. return $this;
  177. }
  178. public function getTextoEn(): ?string
  179. {
  180. return $this->texto_en;
  181. }
  182. public function setTextoEn(?string $texto_en): self
  183. {
  184. $this->texto_en = $texto_en;
  185. return $this;
  186. }
  187. }