vendor/roothirsch/notification-bundle/src/Entity/NotificationReadOn.php line 14

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\NotificationBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Roothirsch\CoreBundle\Entity\User;
  5. use Roothirsch\NotificationBundle\Repository\NotificationReadOnRepository;
  6. use Symfony\Component\Serializer\Annotation\Context;
  7. use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
  8. /**
  9. * @ORM\Entity(repositoryClass=NotificationReadOnRepository::class)
  10. */
  11. class NotificationReadOn
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\OneToOne(targetEntity=User::class, cascade={"persist", "remove"})
  21. * @ORM\JoinColumn(nullable=false)
  22. */
  23. private $user;
  24. /**
  25. * @ORM\Column(type="datetime")
  26. * @Context({"datetime_format":"U"})
  27. */
  28. private $date;
  29. public function getId(): ?int
  30. {
  31. return $this->id;
  32. }
  33. public function getUser(): ?User
  34. {
  35. return $this->user;
  36. }
  37. public function setUser(User $user): self
  38. {
  39. $this->user = $user;
  40. return $this;
  41. }
  42. public function getDate(): ?\DateTimeInterface
  43. {
  44. return $this->date;
  45. }
  46. public function setDate(\DateTimeInterface $date): self
  47. {
  48. $this->date = $date;
  49. return $this;
  50. }
  51. }