<?php
namespace App\Entity;
use App\Repository\NotificationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=NotificationRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class Notification
{
use DateTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="notifications")
* @ORM\JoinColumn(nullable=false)
*/
private $userTo;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=true)
*/
private $userFrom=null;
/**
* @ORM\Column(type="text")
*/
private $message;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $entity_id;
/**
* @ORM\Column(type="boolean", options={"default": "0"} )
*/
private $view=false;
/**
* @Assert\Url(
* relativeProtocol = true
* )
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $link;
public function getId(): ?int
{
return $this->id;
}
public function getUserTo(): ?User
{
return $this->userTo;
}
public function setUserTo(?User $userTo): self
{
$this->userTo = $userTo;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getView(): ?bool
{
return $this->view;
}
public function setView(bool $view): self
{
$this->view = $view;
return $this;
}
/**
* @return mixed
*/
public function getLink()
{
return $this->link;
}
/**
* @param mixed $link
*/
public function setLink($link): void
{
$this->link = $link;
}
/**
* @return mixed
*/
public function getEntityId()
{
return $this->entity_id;
}
/**
* @param mixed $entity_id
*/
public function setEntityId($entity_id): void
{
$this->entity_id = $entity_id;
}
public function getUserFrom(): ?User
{
return $this->userFrom;
}
public function setUserFrom(?User $userFrom): self
{
$this->userFrom = $userFrom;
return $this;
}
}