src/Entity/Notification.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use App\Repository\NotificationRepository;
  6. /**
  7.  * @ORM\Table(name="v_notification")
  8.  * @ORM\Entity(repositoryClass=NotificationRepository::class)
  9.  */
  10. class Notification
  11. {
  12.     const NOTIFICATION_TYPE_POST_LIKE 'POST_LIKE';
  13.     const NOTIFICATION_TYPE_POST_COMMENT 'POST_COMMENT';
  14.     const NOTIFICATION_TYPE_MESSAGE 'MESSAGE';
  15.     const NOTIFICATION_TYPE_NEW_POST 'NEW_POST';
  16.     const NOTIFICATION_TYPE_NEW_POST_GROUP 'NEW_POST_GROUP';
  17.     const NOTIFICATION_TYPE_NEW_MEDICINE_ADD 'NEW_MEDICINE_ADD';
  18.     const NOTIFICATION_TYPE_NEW_MEDICATION_ADD 'NEW_MEDICATION_ADD';
  19.     const NOTIFICATION_TYPE_FEEDBACK_SENT 'FEEDBACK_SENT';
  20.     const NOTIFICATION_TYPE_CONTENT_BLOCK_CHANGED 'CONTENT_BLOCK_CHANGED';
  21.     const NOTIFICATION_TYPE_START_DATE_CHANGED 'START_DATE_CHANGED';
  22.     const NOTIFICATION_TYPE_ACTIVITY_ADDED 'ACTIVITY_ADDED';
  23.     const NOTIFICATION_TYPE_ACTIVITY_ADDED_BULK 'ACTIVITY_ADDED_BULK';
  24.     const NOTIFICATION_TYPE_ACTIVITY_CHANGED 'ACTIVITY_CHANGED';
  25.     const NOTIFICATION_TYPE_ACTIVITY_DELETED 'ACTIVITY_DELETED';
  26.     const NOTIFICATION_TYPE_REFERRAL_COMMISSION_PAID 'REFERRAL_COMMISSION_PAID';
  27.     public static function getNotificationTypeDefinitions(){
  28.         return [
  29.             self::NOTIFICATION_TYPE_POST_LIKE => 'Like',
  30.             self::NOTIFICATION_TYPE_POST_COMMENT => 'Comment',
  31.             self::NOTIFICATION_TYPE_MESSAGE => 'Message',
  32.             self::NOTIFICATION_TYPE_NEW_POST => 'New post',
  33.             self::NOTIFICATION_TYPE_NEW_MEDICINE_ADD => 'New medicine add',
  34.             self::NOTIFICATION_TYPE_NEW_MEDICATION_ADD => 'New medication add',
  35.             self::NOTIFICATION_TYPE_FEEDBACK_SENT => 'Feedback sent',
  36.             self::NOTIFICATION_TYPE_CONTENT_BLOCK_CHANGED => 'Content block changed',
  37.             self::NOTIFICATION_TYPE_START_DATE_CHANGED => 'Start date changed',
  38.             self::NOTIFICATION_TYPE_ACTIVITY_ADDED => 'Activity added',
  39.             self::NOTIFICATION_TYPE_ACTIVITY_ADDED_BULK => 'Activity added bulk',
  40.             self::NOTIFICATION_TYPE_ACTIVITY_CHANGED => 'Activity changed',
  41.             self::NOTIFICATION_TYPE_ACTIVITY_DELETED => 'Activity deleted',
  42.         ];
  43.     }
  44.     /**
  45.      * @ORM\Id
  46.      * @ORM\GeneratedValue
  47.      * @ORM\Column(type="integer")
  48.      */
  49.     private $id;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $notificationType;
  54.     /**
  55.      * @ORM\Column(type="json", nullable=true)
  56.      */
  57.     private $arguments;
  58.     /**
  59.      * @ORM\Column(type="json", nullable=true)
  60.      */
  61.     private $messages;
  62.     /**
  63.      * @ORM\Column(type="boolean")
  64.      */
  65.     private $seen false;
  66.     use CreatedUpdatedTrait;
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getNotificationType(): ?string
  72.     {
  73.         return $this->notificationType;
  74.     }
  75.     public function setNotificationType(string $notificationType): self
  76.     {
  77.         $this->notificationType $notificationType;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return mixed
  82.      */
  83.     public function getArguments()
  84.     {
  85.         return $this->arguments;
  86.     }
  87.     /**
  88.      * @param mixed $arguments
  89.      */
  90.     public function setArguments($arguments): void
  91.     {
  92.         $this->arguments $arguments;
  93.     }
  94.     /**
  95.      * @return mixed
  96.      */
  97.     public function getMessages()
  98.     {
  99.         return $this->messages;
  100.     }
  101.     /**
  102.      * @param mixed $messages
  103.      */
  104.     public function setMessages($messages): void
  105.     {
  106.         $this->messages $messages;
  107.     }
  108.     /**
  109.      * @return bool
  110.      */
  111.     public function isSeen(): ?bool
  112.     {
  113.         return $this->seen;
  114.     }
  115.     /**
  116.      * @param bool $seen
  117.      */
  118.     public function setSeen(?bool $seen): void
  119.     {
  120.         $this->seen $seen;
  121.     }
  122. }