src/Entity/Message.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity(repositoryClass=MessageRepository::class)
  6. * @ORM\AssociationOverrides({
  7. * @ORM\AssociationOverride(
  8. * name="createdBy",
  9. * inversedBy="messages",
  10. * joinColumns={@ORM\JoinColumn(name="created_by", referencedColumnName="id", nullable=true, onDelete="CASCADE")}
  11. * )
  12. * })
  13. */
  14. class Message extends BaseEntity
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="text", nullable=true)
  24. */
  25. private $content;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=true)
  28. */
  29. private $visibility = 'public';
  30. /**
  31. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="receiverMessages")
  32. * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  33. */
  34. private $receiver;
  35. /**
  36. * @ORM\Column(type="boolean", nullable=true)
  37. */
  38. private $isRead;
  39. /**
  40. * @ORM\ManyToOne(targetEntity=Discussion::class, inversedBy="messages")
  41. */
  42. private $discussion;
  43. public function getId(): ?int
  44. {
  45. return $this->id;
  46. }
  47. public function getContent(): ?string
  48. {
  49. return $this->content;
  50. }
  51. public function setContent(?string $content): self
  52. {
  53. $this->content = $content;
  54. return $this;
  55. }
  56. public function getVisibility(): ?string
  57. {
  58. return $this->visibility;
  59. }
  60. public function setVisibility(?string $visibility): self
  61. {
  62. $this->visibility = $visibility;
  63. return $this;
  64. }
  65. public function getReceiver(): ?User
  66. {
  67. return $this->receiver;
  68. }
  69. public function setReceiver(?User $receiver): self
  70. {
  71. $this->receiver = $receiver;
  72. return $this;
  73. }
  74. public function isIsRead(): ?bool
  75. {
  76. return $this->isRead;
  77. }
  78. public function setIsRead(?bool $isRead): self
  79. {
  80. $this->isRead = $isRead;
  81. return $this;
  82. }
  83. public function getDiscussion(): ?Discussion
  84. {
  85. return $this->discussion;
  86. }
  87. public function setDiscussion(?Discussion $discussion): self
  88. {
  89. $this->discussion = $discussion;
  90. return $this;
  91. }
  92. }