<?php
namespace App\Entity;
use App\Repository\UserNotificationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Traits\Timestampable;
use JMS\Serializer\Annotation\Groups;
#[ORM\HasLifecycleCallbacks]
#[ORM\Entity(repositoryClass: UserNotificationRepository::class)]
class UserNotification
{
use Timestampable;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(["getUserNotification"])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(["getUserNotification"])]
private ?string $title = null;
#[ORM\Column(length: 255)]
#[Groups(["getUserNotification"])]
private ?string $content = null;
#[ORM\ManyToOne(inversedBy: 'userNotifications')]
#[ORM\JoinColumn(nullable: false)]
#[Groups(["getUserNotification"])]
private ?User $user = null;
#[ORM\Column(length: 255)]
#[Groups(["getUserNotification"])]
private ?string $type = null;
#[ORM\Column(nullable: true)]
#[Groups(["getUserNotification"])]
private ?int $dataId = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
#[Groups(["getUserNotification"])]
private ?array $data = null;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): static
{
$this->title = $title;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): static
{
$this->content = $content;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
public function getDataId(): ?int
{
return $this->dataId;
}
public function setDataId(?int $dataId): static
{
$this->dataId = $dataId;
return $this;
}
public function getData(): ?array
{
return $this->data;
}
public function setData(?array $data): static
{
$this->data = $data;
return $this;
}
}