<?php
namespace Bundles\Messenger\Entity;
use App\Entity\User;
use Bundles\Messenger\Repository\NotificationRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NotificationRepository::class)
*/
class Notification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=20)
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="notifications")
* @ORM\JoinColumn(nullable=false)
*/
private $User;
/**
* @ORM\Column(type="string", length=20)
*/
private $source;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subject;
/**
* @ORM\Column(type="text")
*/
private $content;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $objectType;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $objectId;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $seen;
/**
* @ORM\Column(type="string", length=20)
*/
private $date;
public function __construct()
{
return $this->setDate(date('Y-m-d H:i'));
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getUser(): ?User
{
return $this->User;
}
public function setUser(?User $User): self
{
$this->User = $User;
return $this;
}
public function getSource(): ?string
{
return $this->source;
}
public function setSource(string $source): self
{
$this->source = $source;
return $this;
}
public function getSubject(): ?string
{
return $this->subject;
}
public function setSubject(?string $subject): self
{
$this->subject = $subject;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getObjectType(): ?string
{
return $this->objectType;
}
public function setObjectType(?string $objectType): self
{
$this->objectType = $objectType;
return $this;
}
public function getObjectId(): ?int
{
return $this->objectId;
}
public function setObjectId(?int $objectId): self
{
$this->objectId = $objectId;
return $this;
}
public function isSeen(): ?bool
{
return $this->seen;
}
public function setSeen(?bool $seen): self
{
$this->seen = $seen;
return $this;
}
public function getDate(): ?string
{
return $this->date;
}
public function setDate(string $date): self
{
$this->date = $date;
return $this;
}
}