<?phpnamespace App\Entity;use App\Utils\ExtendedEntity;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\NotificationsRepository") */class Notification{ use ExtendedEntity; /** * @ORM\GeneratedValue * @ORM\Id * @ORM\Column(type="integer") */ protected $id; /** * @ORM\Column(type="text") */ protected $content; /** * @ORM\Column(type="string", length=255) */ protected $entityType; /** * @ORM\Column(type="integer") */ protected $entityId; /** * @ORM\Column(type="integer", nullable=true) */ protected $contentId; /** * @ORM\Column(type="boolean", options={"default": false}) */ protected $isRead; /** * @ORM\Column(type="datetime", nullable=true) */ protected $readAt; /** * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications_author") * @ORM\JoinColumn(nullable=false) */ private $author; /** * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notifications") * @ORM\JoinColumn(nullable=false) */ private $recipient; const NOTIFICATION_TYPE_OFFER = "offer"; const NOTIFICATION_TYPE_INQUIRY = "inquiry"; const NOTIFICATION_TYPE_INVOICE = "invoice"; const NOTIFICATION_TYPE_PRIVATE_MESSAGE = "private_message"; public function __construct() { $this->active = true; } public function __toString() { return $this->content; } /** * @return mixed */ public function getId() { return $this->id; } /** * @param mixed $id */ public function setId($id): void { $this->id = $id; } /** * @return mixed */ public function getContent() { return $this->content; } /** * @param mixed $content */ public function setContent($content): void { $this->content = $content; } /** * @return mixed */ public function getEntityType() { return $this->entityType; } /** * @param mixed $entityType */ public function setEntityType($entityType): void { $this->entityType = $entityType; } /** * @return mixed */ public function getEntityId() { return $this->entityId; } /** * @param mixed $entityId */ public function setEntityId($entityId): void { $this->entityId = $entityId; } /** * @return mixed */ public function getIsRead() { return $this->isRead; } /** * @param mixed $isRead */ public function setIsRead($isRead): void { $this->isRead = $isRead; } /** * @return mixed */ public function getReadAt() { return $this->readAt; } /** * @param mixed $readAt */ public function setReadAt($readAt): void { $this->readAt = $readAt; } public function getAuthor(): ?Customer { return $this->author; } public function setAuthor(?Customer $author): self { $this->author = $author; return $this; } public function getRecipient(): ?Customer { return $this->recipient; } public function setRecipient(?Customer $recipient): self { $this->recipient = $recipient; return $this; } /** * @return mixed */ public function getContentId() { return $this->contentId; } /** * @param mixed $contentId */ public function setContentId($contentId): void { $this->contentId = $contentId; }}