src/Entity/Chat.php line 14

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. /**
  8. * @ORM\Entity
  9. * @ORM\Table(name="chat")
  10. */
  11. class Chat
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\Column(type="integer")
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  21. */
  22. private $deletedAt;
  23. /**
  24. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  25. */
  26. private $updatedAt;
  27. /**
  28. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  29. */
  30. private $createdAt;
  31. /**
  32. * @ORM\Column(type="string", nullable=true)
  33. */
  34. private $titulo;
  35. /**
  36. * @ORM\Column(type="integer", nullable=true)
  37. */
  38. private $entidad;
  39. /**
  40. * @ORM\Column(type="boolean", nullable=true)
  41. */
  42. private $_sinLeer;
  43. /**
  44. * @ORM\OneToMany(targetEntity=\App\Entity\ParticipanteChat::class, mappedBy="chat")
  45. */
  46. private $participanteChats;
  47. public function __construct()
  48. {
  49. $this->participanteChats = new ArrayCollection();
  50. }
  51. public function getId(): ?int
  52. {
  53. return $this->id;
  54. }
  55. public function setId($id)
  56. {
  57. $this->id = $id;
  58. return $this;
  59. }
  60. public function getDeletedAt(): ?\DateTimeInterface
  61. {
  62. return $this->deletedAt;
  63. }
  64. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  65. {
  66. $this->deletedAt = $deletedAt;
  67. return $this;
  68. }
  69. public function getUpdatedAt(): ?\DateTimeInterface
  70. {
  71. return $this->updatedAt;
  72. }
  73. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  74. {
  75. $this->updatedAt = $updatedAt;
  76. return $this;
  77. }
  78. public function getCreatedAt(): ?\DateTimeInterface
  79. {
  80. return $this->createdAt;
  81. }
  82. public function setCreatedAt(\DateTimeInterface $createdAt): static
  83. {
  84. $this->createdAt = $createdAt;
  85. return $this;
  86. }
  87. public function getTitulo(): ?string
  88. {
  89. return $this->titulo;
  90. }
  91. public function setTitulo(?string $titulo): static
  92. {
  93. $this->titulo = $titulo;
  94. return $this;
  95. }
  96. public function getEntidad(): ?int
  97. {
  98. return $this->entidad;
  99. }
  100. public function setEntidad(?int $entidad): static
  101. {
  102. $this->entidad = $entidad;
  103. return $this;
  104. }
  105. public function isSinLeer(): ?bool
  106. {
  107. return $this->_sinLeer;
  108. }
  109. public function setSinLeer(?bool $_sinLeer): static
  110. {
  111. $this->_sinLeer = $_sinLeer;
  112. return $this;
  113. }
  114. /**
  115. * @return Collection<int, ParticipanteChat>
  116. */
  117. public function getParticipanteChats(): Collection
  118. {
  119. return $this->participanteChats;
  120. }
  121. public function addParticipanteChat(ParticipanteChat $participanteChat): static
  122. {
  123. if (!$this->participanteChats->contains($participanteChat)) {
  124. $this->participanteChats->add($participanteChat);
  125. }
  126. return $this;
  127. }
  128. public function removeParticipanteChat(ParticipanteChat $participanteChat): static
  129. {
  130. $this->participanteChats->removeElement($participanteChat);
  131. return $this;
  132. }
  133. }