<?php
namespace App\Entity;
use App\Repository\PNotificationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PNotificationRepository::class)]
class PNotification
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'notifications')]
private ?Users $user = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $message = null;
#[ORM\Column(nullable: true)]
private ?bool $seen = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $created = null;
public function __construct()
{
$this->created = new \DateTime();
$this->seen = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?Users
{
return $this->user;
}
public function setUser(?Users $user): static
{
$this->user = $user;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): static
{
$this->message = $message;
return $this;
}
public function isSeen(): ?bool
{
return $this->seen;
}
public function setSeen(?bool $seen): static
{
$this->seen = $seen;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(?\DateTimeInterface $created): static
{
$this->created = $created;
return $this;
}
}