<?php
namespace App\Database\Domain\Entity\User;
use App\Database\Domain\Entity\AbstractEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity(repositoryClass="App\Database\Domain\Repository\NotificationRepository")
*/
class UserNotification extends AbstractEntity
{
public const CUSTOM_SUB_ONE_WEEK_END = 1;
public const EMAIL_CRON_INACTIVE_USERS = 2;
public const EMAIL_CRON_EDUCATIONAL = 3;
public const EMAIL_CRON_FINAL = 4;
public const EMAIL_CRON_GET_TOAST_FOR_FREE = 5;
public const EMAIL_CRON_AFTER_SUBSCRIPTION = 6;
public const EMAIL_CRON_PRO_FINISH = 7;
/**
* @ORM\ManyToOne(targetEntity="App\Database\Domain\Entity\User\User", inversedBy="notifications")
*
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private UserInterface $user;
/**
* @ORM\Column(type="integer")
*/
private int $type;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $message;
public function __construct(string $id, int $type, UserInterface $user, ?string $message = null)
{
$this->id = $id;
$this->type = $type;
$this->message = $message;
$this->user = $user;
}
public function getType(): int
{
return $this->type;
}
public function setType(int $type): self
{
$this->type = $type;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
}