src/Entity/UserNotification.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserNotificationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=UserNotificationRepository::class)
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class UserNotification
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userNotifications")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $user;
  22.     /**
  23.      * @ORM\Column(type="text")
  24.      */
  25.     private $text;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $linkUrl;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $linkLabel;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $category;
  38.     /**
  39.      * @ORM\Column(type="datetime_immutable", nullable=true)
  40.      */
  41.     private $seenAt;
  42.     /**
  43.      * @ORM\Column(type="datetime_immutable", nullable=true)
  44.      */
  45.     private $createdAt;
  46.     /**
  47.      * @ORM\Column(type="date", nullable=true)
  48.      */
  49.     private $expiresAt;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $relatedType;
  54.     /**
  55.      * @ORM\Column(type="integer", nullable=true)
  56.      */
  57.     private $relatedId;
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getUser(): ?User
  63.     {
  64.         return $this->user;
  65.     }
  66.     public function setUser(?User $user): self
  67.     {
  68.         $this->user $user;
  69.         return $this;
  70.     }
  71.     public function getText(): ?string
  72.     {
  73.         return $this->text;
  74.     }
  75.     public function setText(string $text): self
  76.     {
  77.         $this->text $text;
  78.         return $this;
  79.     }
  80.     public function getLinkUrl(): ?string
  81.     {
  82.         return $this->linkUrl;
  83.     }
  84.     public function setLinkUrl(?string $linkUrl): self
  85.     {
  86.         $this->linkUrl $linkUrl;
  87.         return $this;
  88.     }
  89.     public function getLinkLabel(): ?string
  90.     {
  91.         return $this->linkLabel;
  92.     }
  93.     public function setLinkLabel(?string $linkLabel): self
  94.     {
  95.         $this->linkLabel $linkLabel;
  96.         return $this;
  97.     }
  98.     public function getCategory(): ?string
  99.     {
  100.         return $this->category;
  101.     }
  102.     public function setCategory(?string $category): self
  103.     {
  104.         $this->category $category;
  105.         return $this;
  106.     }
  107.     public function getSeenAt(): ?\DateTimeImmutable
  108.     {
  109.         return $this->seenAt;
  110.     }
  111.     public function setSeenAt(?\DateTimeImmutable $seenAt): self
  112.     {
  113.         $this->seenAt $seenAt;
  114.         return $this;
  115.     }
  116.     public function getCreatedAt(): ?\DateTimeImmutable
  117.     {
  118.         return $this->createdAt;
  119.     }
  120.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  121.     {
  122.         $this->createdAt $createdAt;
  123.         return $this;
  124.     }
  125.     public function getExpiresAt(): ?\DateTimeInterface
  126.     {
  127.         return $this->expiresAt;
  128.     }
  129.     public function setExpiresAt(?\DateTimeInterface $expiresAt): self
  130.     {
  131.         $this->expiresAt $expiresAt;
  132.         return $this;
  133.     }
  134.     /**
  135.      * @ORM\PrePersist
  136.      */
  137.     public function prePersist(): void
  138.     {
  139.         if ($this->createdAt === null) {
  140.             $this->createdAt = new \DateTimeImmutable();
  141.         }
  142.     }
  143.     public function getRelatedType(): ?string
  144.     {
  145.         return $this->relatedType;
  146.     }
  147.     public function setRelatedType(?string $relatedType): self
  148.     {
  149.         $this->relatedType $relatedType;
  150.         return $this;
  151.     }
  152.     public function getRelatedId(): ?int
  153.     {
  154.         return $this->relatedId;
  155.     }
  156.     public function setRelatedId(?int $relatedId): self
  157.     {
  158.         $this->relatedId $relatedId;
  159.         return $this;
  160.     }
  161. }