PrivateMessage.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrivateMessageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=PrivateMessageRepository::class)
  7. */
  8. class PrivateMessage
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(type="string", length=255)
  18. */
  19. private $text;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=PrivateDiscussion::class, inversedBy="privateMessages")
  22. * @ORM\JoinColumn(nullable=false)
  23. */
  24. private $privateDiscussion;
  25. /**
  26. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="privateMessages")
  27. * @ORM\JoinColumn(nullable=false)
  28. */
  29. private $sender;
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getText(): ?string
  35. {
  36. return $this->text;
  37. }
  38. public function setText(string $text): self
  39. {
  40. $this->text = $text;
  41. return $this;
  42. }
  43. public function getPrivateDiscussion(): ?PrivateDiscussion
  44. {
  45. return $this->privateDiscussion;
  46. }
  47. public function setPrivateDiscussion(?PrivateDiscussion $privateDiscussion): self
  48. {
  49. $this->privateDiscussion = $privateDiscussion;
  50. return $this;
  51. }
  52. public function getSender(): ?User
  53. {
  54. return $this->sender;
  55. }
  56. public function setSender(?User $sender): self
  57. {
  58. $this->sender = $sender;
  59. return $this;
  60. }
  61. }