src/Entity/Notification.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=NotificationRepository::class)
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class Notification
  11. {
  12.     use DateTrait;
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="notifications")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $userTo;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=User::class)
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $userFrom=null;
  29.     /**
  30.      * @ORM\Column(type="text")
  31.      */
  32.     private $message;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $type;
  37.     /**
  38.      * @ORM\Column(type="integer", nullable=true)
  39.      */
  40.     private $entity_id;
  41.     /**
  42.      * @ORM\Column(type="boolean", options={"default": "0"} )
  43.      */
  44.     private $view=false;
  45.     /**
  46.      * @Assert\Url(
  47.      *     relativeProtocol = true
  48.      * )
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $link;
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getUserTo(): ?User
  57.     {
  58.         return $this->userTo;
  59.     }
  60.     public function setUserTo(?User $userTo): self
  61.     {
  62.         $this->userTo $userTo;
  63.         return $this;
  64.     }
  65.     public function getMessage(): ?string
  66.     {
  67.         return $this->message;
  68.     }
  69.     public function setMessage(string $message): self
  70.     {
  71.         $this->message $message;
  72.         return $this;
  73.     }
  74.     public function getType(): ?string
  75.     {
  76.         return $this->type;
  77.     }
  78.     public function setType(?string $type): self
  79.     {
  80.         $this->type $type;
  81.         return $this;
  82.     }
  83.     public function getView(): ?bool
  84.     {
  85.         return $this->view;
  86.     }
  87.     public function setView(bool $view): self
  88.     {
  89.         $this->view $view;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return mixed
  94.      */
  95.     public function getLink()
  96.     {
  97.         return $this->link;
  98.     }
  99.     /**
  100.      * @param mixed $link
  101.      */
  102.     public function setLink($link): void
  103.     {
  104.         $this->link $link;
  105.     }
  106.     /**
  107.      * @return mixed
  108.      */
  109.     public function getEntityId()
  110.     {
  111.         return $this->entity_id;
  112.     }
  113.     /**
  114.      * @param mixed $entity_id
  115.      */
  116.     public function setEntityId($entity_id): void
  117.     {
  118.         $this->entity_id $entity_id;
  119.     }
  120.     public function getUserFrom(): ?User
  121.     {
  122.         return $this->userFrom;
  123.     }
  124.     public function setUserFrom(?User $userFrom): self
  125.     {
  126.         $this->userFrom $userFrom;
  127.         return $this;
  128.     }
  129. }