src/Entity/MensajeLeidoForo.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity
  6. */
  7. class MensajeLeidoForo
  8. {
  9. /**
  10. * @ORM\Id
  11. * @ORM\GeneratedValue(strategy="AUTO")
  12. * @ORM\Column(type="integer")
  13. */
  14. private $id;
  15. /**
  16. * @ORM\ManyToOne(targetEntity=\App\Entity\MensajeForo::class, inversedBy="mensajeLeidoForos")
  17. * @ORM\JoinColumn(name="mensaje_foro_id", referencedColumnName="id", nullable=false)
  18. */
  19. private $mensaje;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=\App\Entity\UsuarioHermes::class, inversedBy="mensajeLeidoForos")
  22. * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id", nullable=false)
  23. */
  24. private $usuario;
  25. /**
  26. * @ORM\Column(type="date_immutable", nullable=true)
  27. */
  28. private $readAt;
  29. public function __construct()
  30. {
  31. $this->readAt = new \DateTimeImmutable();
  32. }
  33. public function getId(): ?int
  34. {
  35. return $this->id;
  36. }
  37. public function getMensaje(): ?MensajeForo
  38. {
  39. return $this->mensaje;
  40. }
  41. public function setMensaje(?MensajeForo $mensaje): static
  42. {
  43. $this->mensaje = $mensaje;
  44. return $this;
  45. }
  46. public function getUsuario(): ?UsuarioHermes
  47. {
  48. return $this->usuario;
  49. }
  50. public function setUsuario(?UsuarioHermes $usuario): static
  51. {
  52. $this->usuario = $usuario;
  53. return $this;
  54. }
  55. public function getReadAt(): ?\DateTimeImmutable
  56. {
  57. return $this->readAt;
  58. }
  59. public function setReadAt(\DateTimeImmutable $readAt): static
  60. {
  61. $this->readAt = $readAt;
  62. return $this;
  63. }
  64. }