src/Entity/Core/Notifications.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use App\Entity\Core\Agencies;
  4. use Doctrine\DBAL\Types\Types;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * Notifications
  10. *
  11. * @ORM\Table("core_notifications")
  12. * @ORM\Entity(repositoryClass="App\Repository\Core\NotificationsRepository")
  13. * @ORM\HasLifecycleCallbacks()
  14. */
  15. class Notifications
  16. {
  17. /**
  18. * @var integer
  19. *
  20. * @ORM\Column(name="id", type="integer")
  21. * @ORM\Id
  22. * @ORM\GeneratedValue(strategy="AUTO")
  23. */
  24. protected $id;
  25. /**
  26. * @var string
  27. *
  28. * @ORM\Column(name="created_at", type="datetime", nullable=true)
  29. */
  30. private $createdAt;
  31. /**
  32. * @var string
  33. *
  34. * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  35. */
  36. private $updatedAt;
  37. /**
  38. * @var string
  39. *
  40. * @ORM\Column(name="title", type="text", nullable=true)
  41. */
  42. private $title;
  43. /**
  44. * @var string
  45. *
  46. * @ORM\Column(name="description", type="text", nullable=true)
  47. */
  48. private $description;
  49. /**
  50. * @var string
  51. *
  52. * @ORM\Column(name="type", type="text", nullable=true)
  53. */
  54. private $type;
  55. /**
  56. * @var string
  57. *
  58. * @ORM\Column(name="only_admin", type="boolean", nullable=true)
  59. */
  60. private $onlyAdmin;
  61. /**
  62. * @var \Users
  63. *
  64. * @ORM\ManyToOne(targetEntity="App\Entity\Core\Users")
  65. * @ORM\JoinColumns({
  66. * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  67. * })
  68. */
  69. protected $user;
  70. /**
  71. * @var string
  72. *
  73. * @ORM\Column(name="viewed", type="boolean", nullable=true)
  74. */
  75. private $viewed;
  76. /**
  77. * @ORM\PrePersist
  78. */
  79. public function setCreatedAtValue(): void {
  80. $this->setCreatedAt(new \DateTime("now"));
  81. $this->setUpdatedAt(new \DateTime("now"));
  82. }
  83. /**
  84. * @ORM\PreUpdate
  85. */
  86. public function setUpdatedAtValue(): void {
  87. $this->setUpdatedAt(new \DateTime("now"));
  88. }
  89. public function __toString() {
  90. return $this->title;
  91. }
  92. public function getId(): ?int
  93. {
  94. return $this->id;
  95. }
  96. public function getCreatedAt(): ?\DateTimeInterface
  97. {
  98. return $this->createdAt;
  99. }
  100. public function setCreatedAt(?\DateTimeInterface $createdAt): static
  101. {
  102. $this->createdAt = $createdAt;
  103. return $this;
  104. }
  105. public function getUpdatedAt(): ?\DateTimeInterface
  106. {
  107. return $this->updatedAt;
  108. }
  109. public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  110. {
  111. $this->updatedAt = $updatedAt;
  112. return $this;
  113. }
  114. public function getTitle(): ?string
  115. {
  116. return $this->title;
  117. }
  118. public function setTitle(?string $title): static
  119. {
  120. $this->title = $title;
  121. return $this;
  122. }
  123. public function getDescription(): ?string
  124. {
  125. return $this->description;
  126. }
  127. public function setDescription(?string $description): static
  128. {
  129. $this->description = $description;
  130. return $this;
  131. }
  132. public function getType(): ?string
  133. {
  134. return $this->type;
  135. }
  136. public function setType(?string $type): static
  137. {
  138. $this->type = $type;
  139. return $this;
  140. }
  141. public function isOnlyAdmin(): ?bool
  142. {
  143. return $this->onlyAdmin;
  144. }
  145. public function setOnlyAdmin(?bool $onlyAdmin): static
  146. {
  147. $this->onlyAdmin = $onlyAdmin;
  148. return $this;
  149. }
  150. public function getUser(): ?Users
  151. {
  152. return $this->user;
  153. }
  154. public function setUser(?Users $user): static
  155. {
  156. $this->user = $user;
  157. return $this;
  158. }
  159. public function isViewed(): ?bool
  160. {
  161. return $this->viewed;
  162. }
  163. public function setViewed(?bool $viewed): static
  164. {
  165. $this->viewed = $viewed;
  166. return $this;
  167. }
  168. }