src/Bundles/Messenger/Entity/Notification.php line 12

Open in your IDE?
  1. <?php
  2. namespace Bundles\Messenger\Entity;
  3. use App\Entity\User;
  4. use Bundles\Messenger\Repository\NotificationRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=NotificationRepository::class)
  8. */
  9. class Notification
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", length=20)
  19. */
  20. private $type;
  21. /**
  22. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="notifications")
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. private $User;
  26. /**
  27. * @ORM\Column(type="string", length=20)
  28. */
  29. private $source;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. private $subject;
  34. /**
  35. * @ORM\Column(type="text")
  36. */
  37. private $content;
  38. /**
  39. * @ORM\Column(type="string", length=20, nullable=true)
  40. */
  41. private $objectType;
  42. /**
  43. * @ORM\Column(type="integer", nullable=true)
  44. */
  45. private $objectId;
  46. /**
  47. * @ORM\Column(type="boolean", nullable=true)
  48. */
  49. private $seen;
  50. /**
  51. * @ORM\Column(type="string", length=20)
  52. */
  53. private $date;
  54. public function __construct()
  55. {
  56. return $this->setDate(date('Y-m-d H:i'));
  57. }
  58. public function getId(): ?int
  59. {
  60. return $this->id;
  61. }
  62. public function getType(): ?string
  63. {
  64. return $this->type;
  65. }
  66. public function setType(string $type): self
  67. {
  68. $this->type = $type;
  69. return $this;
  70. }
  71. public function getUser(): ?User
  72. {
  73. return $this->User;
  74. }
  75. public function setUser(?User $User): self
  76. {
  77. $this->User = $User;
  78. return $this;
  79. }
  80. public function getSource(): ?string
  81. {
  82. return $this->source;
  83. }
  84. public function setSource(string $source): self
  85. {
  86. $this->source = $source;
  87. return $this;
  88. }
  89. public function getSubject(): ?string
  90. {
  91. return $this->subject;
  92. }
  93. public function setSubject(?string $subject): self
  94. {
  95. $this->subject = $subject;
  96. return $this;
  97. }
  98. public function getContent(): ?string
  99. {
  100. return $this->content;
  101. }
  102. public function setContent(string $content): self
  103. {
  104. $this->content = $content;
  105. return $this;
  106. }
  107. public function getObjectType(): ?string
  108. {
  109. return $this->objectType;
  110. }
  111. public function setObjectType(?string $objectType): self
  112. {
  113. $this->objectType = $objectType;
  114. return $this;
  115. }
  116. public function getObjectId(): ?int
  117. {
  118. return $this->objectId;
  119. }
  120. public function setObjectId(?int $objectId): self
  121. {
  122. $this->objectId = $objectId;
  123. return $this;
  124. }
  125. public function isSeen(): ?bool
  126. {
  127. return $this->seen;
  128. }
  129. public function setSeen(?bool $seen): self
  130. {
  131. $this->seen = $seen;
  132. return $this;
  133. }
  134. public function getDate(): ?string
  135. {
  136. return $this->date;
  137. }
  138. public function setDate(string $date): self
  139. {
  140. $this->date = $date;
  141. return $this;
  142. }
  143. }