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.      * Snapshot of the publication requirement when the notification is created.
  47.      *
  48.      * @ORM\Column(type="boolean", options={"default": "0"})
  49.      */
  50.     private $required false;
  51.     /**
  52.      * @Assert\Url(
  53.      *     relativeProtocol = true
  54.      * )
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $link;
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getUserTo(): ?User
  63.     {
  64.         return $this->userTo;
  65.     }
  66.     public function setUserTo(?User $userTo): self
  67.     {
  68.         $this->userTo $userTo;
  69.         return $this;
  70.     }
  71.     public function getMessage(): ?string
  72.     {
  73.         return $this->message;
  74.     }
  75.     public function setMessage(string $message): self
  76.     {
  77.         $this->message $message;
  78.         return $this;
  79.     }
  80.     public function getType(): ?string
  81.     {
  82.         return $this->type;
  83.     }
  84.     public function setType(?string $type): self
  85.     {
  86.         $this->type $type;
  87.         return $this;
  88.     }
  89.     public function getView(): ?bool
  90.     {
  91.         return $this->view;
  92.     }
  93.     public function setView(bool $view): self
  94.     {
  95.         $this->view $view;
  96.         return $this;
  97.     }
  98.     public function getRequired(): bool
  99.     {
  100.         return $this->required;
  101.     }
  102.     public function setRequired(bool $required): self
  103.     {
  104.         $this->required $required;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return mixed
  109.      */
  110.     public function getLink()
  111.     {
  112.         return $this->link;
  113.     }
  114.     /**
  115.      * @param mixed $link
  116.      */
  117.     public function setLink($link): void
  118.     {
  119.         $this->link $link;
  120.     }
  121.     /**
  122.      * @return mixed
  123.      */
  124.     public function getEntityId()
  125.     {
  126.         return $this->entity_id;
  127.     }
  128.     /**
  129.      * @param mixed $entity_id
  130.      */
  131.     public function setEntityId($entity_id): void
  132.     {
  133.         $this->entity_id $entity_id;
  134.     }
  135.     public function getUserFrom(): ?User
  136.     {
  137.         return $this->userFrom;
  138.     }
  139.     public function setUserFrom(?User $userFrom): self
  140.     {
  141.         $this->userFrom $userFrom;
  142.         return $this;
  143.     }
  144. }