src/Entity/UserNotification.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserNotificationRepository;
  4. use DateTimeInterface;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use DateTime;
  7. /**
  8.  * @ORM\Entity(repositoryClass=UserNotificationRepository::class)
  9.  */
  10. class UserNotification
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userNotifications")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $user;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Notification::class, inversedBy="userNotifications")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $notification;
  28.     /**
  29.      * @ORM\Column(type="boolean")
  30.      */
  31.     private $isRead false;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true)
  34.      */
  35.     private $readAt;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getUser(): User
  41.     {
  42.         return $this->user;
  43.     }
  44.     public function setUser(User $user): self
  45.     {
  46.         $this->user $user;
  47.         return $this;
  48.     }
  49.     public function getNotification(): ?Notification
  50.     {
  51.         return $this->notification;
  52.     }
  53.     public function setNotification(?Notification $notification): self
  54.     {
  55.         $this->notification $notification;
  56.         return $this;
  57.     }
  58.     public function getIsRead(): ?bool
  59.     {
  60.         return $this->isRead;
  61.     }
  62.     public function setIsRead(bool $isRead): self
  63.     {
  64.         $this->isRead $isRead;
  65.         return $this;
  66.     }
  67.     public function getReadAt(): ?DateTimeInterface
  68.     {
  69.         return $this->readAt;
  70.     }
  71.     public function setReadAt(?DateTimeInterface $readAt): self
  72.     {
  73.         $this->readAt $readAt;
  74.         return $this;
  75.     }
  76. }