<?php
namespace App\Entity;
use App\Repository\UserNotificationRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=UserNotificationRepository::class)
*/
class UserNotification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="userNotifications")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Notification::class, inversedBy="userNotifications")
* @ORM\JoinColumn(nullable=false)
*/
private $notification;
/**
* @ORM\Column(type="boolean")
*/
private $isRead = false;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $readAt;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): User
{
return $this->user;
}
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
public function getNotification(): ?Notification
{
return $this->notification;
}
public function setNotification(?Notification $notification): self
{
$this->notification = $notification;
return $this;
}
public function getIsRead(): ?bool
{
return $this->isRead;
}
public function setIsRead(bool $isRead): self
{
$this->isRead = $isRead;
return $this;
}
public function getReadAt(): ?DateTimeInterface
{
return $this->readAt;
}
public function setReadAt(?DateTimeInterface $readAt): self
{
$this->readAt = $readAt;
return $this;
}
}