src/Entity/Notification.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Utils\ExtendedEntity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\NotificationsRepository")
  7.  */
  8. class Notification
  9. {
  10.     use ExtendedEntity;
  11.     /**
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     protected $id;
  17.     /**
  18.      * @ORM\Column(type="text")
  19.      */
  20.     protected $content;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     protected $entityType;
  25.     /**
  26.      * @ORM\Column(type="integer")
  27.      */
  28.     protected $entityId;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable=true)
  31.      */
  32.     protected $contentId;
  33.     /**
  34.      * @ORM\Column(type="boolean", options={"default": false})
  35.      */
  36.     protected $isRead;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     protected $readAt;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications_author")
  43.      * @ORM\JoinColumn(nullable=false)
  44.      */
  45.     private $author;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications")
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $recipient;
  51.     const NOTIFICATION_TYPE_OFFER "offer";
  52.     const NOTIFICATION_TYPE_INQUIRY "inquiry";
  53.     const NOTIFICATION_TYPE_INVOICE "invoice";
  54.     const NOTIFICATION_TYPE_PRIVATE_MESSAGE "private_message";
  55.     public function __construct()
  56.     {
  57.         $this->active true;
  58.     }
  59.     public function __toString()
  60.     {
  61.         return $this->content;
  62.     }
  63.     /**
  64.      * @return mixed
  65.      */
  66.     public function getId()
  67.     {
  68.         return $this->id;
  69.     }
  70.     /**
  71.      * @param mixed $id
  72.      */
  73.     public function setId($id): void
  74.     {
  75.         $this->id $id;
  76.     }
  77.     /**
  78.      * @return mixed
  79.      */
  80.     public function getContent()
  81.     {
  82.         return $this->content;
  83.     }
  84.     /**
  85.      * @param mixed $content
  86.      */
  87.     public function setContent($content): void
  88.     {
  89.         $this->content $content;
  90.     }
  91.     /**
  92.      * @return mixed
  93.      */
  94.     public function getEntityType()
  95.     {
  96.         return $this->entityType;
  97.     }
  98.     /**
  99.      * @param mixed $entityType
  100.      */
  101.     public function setEntityType($entityType): void
  102.     {
  103.         $this->entityType $entityType;
  104.     }
  105.     /**
  106.      * @return mixed
  107.      */
  108.     public function getEntityId()
  109.     {
  110.         return $this->entityId;
  111.     }
  112.     /**
  113.      * @param mixed $entityId
  114.      */
  115.     public function setEntityId($entityId): void
  116.     {
  117.         $this->entityId $entityId;
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getIsRead()
  123.     {
  124.         return $this->isRead;
  125.     }
  126.     /**
  127.      * @param mixed $isRead
  128.      */
  129.     public function setIsRead($isRead): void
  130.     {
  131.         $this->isRead $isRead;
  132.     }
  133.     /**
  134.      * @return mixed
  135.      */
  136.     public function getReadAt()
  137.     {
  138.         return $this->readAt;
  139.     }
  140.     /**
  141.      * @param mixed $readAt
  142.      */
  143.     public function setReadAt($readAt): void
  144.     {
  145.         $this->readAt $readAt;
  146.     }
  147.     public function getAuthor(): ?Customer
  148.     {
  149.         return $this->author;
  150.     }
  151.     public function setAuthor(?Customer $author): self
  152.     {
  153.         $this->author $author;
  154.         return $this;
  155.     }
  156.     public function getRecipient(): ?Customer
  157.     {
  158.         return $this->recipient;
  159.     }
  160.     public function setRecipient(?Customer $recipient): self
  161.     {
  162.         $this->recipient $recipient;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return mixed
  167.      */
  168.     public function getContentId()
  169.     {
  170.         return $this->contentId;
  171.     }
  172.     /**
  173.      * @param mixed $contentId
  174.      */
  175.     public function setContentId($contentId): void
  176.     {
  177.         $this->contentId $contentId;
  178.     }
  179. }