vendor/roothirsch/notification-bundle/src/Entity/Notification.php line 25

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\NotificationBundle\Entity;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use Roothirsch\NotificationBundle\API\FetchController;
  7. use Roothirsch\NotificationBundle\API\ReadController;
  8. use Roothirsch\NotificationBundle\API\CheckController;
  9. use Roothirsch\NotificationBundle\Repository\NotificationRepository;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. /**
  12. * @ApiResource(
  13. * collectionOperations={
  14. * "get"
  15. * },
  16. * itemOperations={
  17. * "get"
  18. * }
  19. * )
  20. * @ORM\Entity(repositoryClass=NotificationRepository::class)
  21. */
  22. class Notification
  23. {
  24. /**
  25. * @ORM\Id
  26. * @ORM\GeneratedValue
  27. * @ORM\Column(type="integer")
  28. */
  29. private $id;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. * @Gedmo\Translatable
  33. */
  34. private $title;
  35. /**
  36. * @ORM\Column(type="text", nullable=true)
  37. * @Gedmo\Translatable
  38. */
  39. private $content;
  40. /**
  41. * @ORM\Column(type="datetime_immutable")
  42. */
  43. private $createdAt;
  44. public function __construct()
  45. {
  46. $this->createdAt = new \DateTimeImmutable();
  47. }
  48. public function getId(): ?int
  49. {
  50. return $this->id;
  51. }
  52. public function getTitle(): ?string
  53. {
  54. return $this->title;
  55. }
  56. public function setTitle(string $title): self
  57. {
  58. $this->title = $title;
  59. return $this;
  60. }
  61. public function getContent(): ?string
  62. {
  63. return $this->content;
  64. }
  65. public function setContent(string $content): self
  66. {
  67. $this->content = $content;
  68. return $this;
  69. }
  70. public function getCreatedAt(): ?\DateTimeImmutable
  71. {
  72. return $this->createdAt;
  73. }
  74. public function setCreatedAt(\DateTimeImmutable $createdAt): self
  75. {
  76. $this->createdAt = $createdAt;
  77. return $this;
  78. }
  79. }