<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Traits\CreatedUpdatedTrait;
use App\Repository\NotificationRepository;
/**
* @ORM\Table(name="v_notification")
* @ORM\Entity(repositoryClass=NotificationRepository::class)
*/
class Notification
{
const NOTIFICATION_TYPE_POST_LIKE = 'POST_LIKE';
const NOTIFICATION_TYPE_POST_COMMENT = 'POST_COMMENT';
const NOTIFICATION_TYPE_MESSAGE = 'MESSAGE';
const NOTIFICATION_TYPE_NEW_POST = 'NEW_POST';
const NOTIFICATION_TYPE_NEW_POST_GROUP = 'NEW_POST_GROUP';
const NOTIFICATION_TYPE_NEW_MEDICINE_ADD = 'NEW_MEDICINE_ADD';
const NOTIFICATION_TYPE_NEW_MEDICATION_ADD = 'NEW_MEDICATION_ADD';
const NOTIFICATION_TYPE_FEEDBACK_SENT = 'FEEDBACK_SENT';
const NOTIFICATION_TYPE_CONTENT_BLOCK_CHANGED = 'CONTENT_BLOCK_CHANGED';
const NOTIFICATION_TYPE_START_DATE_CHANGED = 'START_DATE_CHANGED';
const NOTIFICATION_TYPE_ACTIVITY_ADDED = 'ACTIVITY_ADDED';
const NOTIFICATION_TYPE_ACTIVITY_ADDED_BULK = 'ACTIVITY_ADDED_BULK';
const NOTIFICATION_TYPE_ACTIVITY_CHANGED = 'ACTIVITY_CHANGED';
const NOTIFICATION_TYPE_ACTIVITY_DELETED = 'ACTIVITY_DELETED';
const NOTIFICATION_TYPE_REFERRAL_COMMISSION_PAID = 'REFERRAL_COMMISSION_PAID';
public static function getNotificationTypeDefinitions(){
return [
self::NOTIFICATION_TYPE_POST_LIKE => 'Like',
self::NOTIFICATION_TYPE_POST_COMMENT => 'Comment',
self::NOTIFICATION_TYPE_MESSAGE => 'Message',
self::NOTIFICATION_TYPE_NEW_POST => 'New post',
self::NOTIFICATION_TYPE_NEW_MEDICINE_ADD => 'New medicine add',
self::NOTIFICATION_TYPE_NEW_MEDICATION_ADD => 'New medication add',
self::NOTIFICATION_TYPE_FEEDBACK_SENT => 'Feedback sent',
self::NOTIFICATION_TYPE_CONTENT_BLOCK_CHANGED => 'Content block changed',
self::NOTIFICATION_TYPE_START_DATE_CHANGED => 'Start date changed',
self::NOTIFICATION_TYPE_ACTIVITY_ADDED => 'Activity added',
self::NOTIFICATION_TYPE_ACTIVITY_ADDED_BULK => 'Activity added bulk',
self::NOTIFICATION_TYPE_ACTIVITY_CHANGED => 'Activity changed',
self::NOTIFICATION_TYPE_ACTIVITY_DELETED => 'Activity deleted',
];
}
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $notificationType;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $arguments;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $messages;
/**
* @ORM\Column(type="boolean")
*/
private $seen = false;
use CreatedUpdatedTrait;
public function getId(): ?int
{
return $this->id;
}
public function getNotificationType(): ?string
{
return $this->notificationType;
}
public function setNotificationType(string $notificationType): self
{
$this->notificationType = $notificationType;
return $this;
}
/**
* @return mixed
*/
public function getArguments()
{
return $this->arguments;
}
/**
* @param mixed $arguments
*/
public function setArguments($arguments): void
{
$this->arguments = $arguments;
}
/**
* @return mixed
*/
public function getMessages()
{
return $this->messages;
}
/**
* @param mixed $messages
*/
public function setMessages($messages): void
{
$this->messages = $messages;
}
/**
* @return bool
*/
public function isSeen(): ?bool
{
return $this->seen;
}
/**
* @param bool $seen
*/
public function setSeen(?bool $seen): void
{
$this->seen = $seen;
}
}