<?php
namespace App\Entity;
use App\Repository\NotificationRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NotificationRepository::class)
*/
class Notification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="notifications")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="string", length=512)
*/
private $title;
/**
* @ORM\Column(type="datetime")
*/
private $date;
/**
* @ORM\Column(type="boolean")
*/
private $viewed;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $message = [];
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 getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getViewed(): ?bool
{
return $this->viewed;
}
public function setViewed(bool $viewed): self
{
$this->viewed = $viewed;
return $this;
}
public function getMessage(): ?array
{
return $this->message;
}
public function setMessage(?array $message): self
{
$this->message = $message;
return $this;
}
}