src/Entity/UserNotificationEntry.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserNotificationEntryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=UserNotificationEntryRepository::class)
  7.  */
  8. class UserNotificationEntry
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userNotificationEntries")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $user;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=BlogPostNotification::class)
  23.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  24.      */
  25.     private $notification;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $isRead;
  30.     /**
  31.      * @ORM\Column(type="datetime_immutable")
  32.      */
  33.     private $createdAt;
  34.     /**
  35.      * @ORM\Column(type="datetime_immutable")
  36.      */
  37.     private $updatedAt;
  38.     public function __construct()
  39.     {
  40.         $this->isRead false;
  41.         $this->createdAt = new \DateTimeImmutable();
  42.         $this->updatedAt = new \DateTimeImmutable();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getUser(): ?User
  49.     {
  50.         return $this->user;
  51.     }
  52.     public function setUser(?User $user): self
  53.     {
  54.         $this->user $user;
  55.         return $this;
  56.     }
  57.     public function getNotification(): ?BlogPostNotification
  58.     {
  59.         return $this->notification;
  60.     }
  61.     public function setNotification(?BlogPostNotification $notification): self
  62.     {
  63.         $this->notification $notification;
  64.         return $this;
  65.     }
  66.     public function isIsRead(): ?bool
  67.     {
  68.         return $this->isRead;
  69.     }
  70.     public function setIsRead(bool $isRead): self
  71.     {
  72.         $this->isRead $isRead;
  73.         return $this;
  74.     }
  75.     public function getCreatedAt(): ?\DateTimeImmutable
  76.     {
  77.         return $this->createdAt;
  78.     }
  79.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  80.     {
  81.         $this->createdAt $createdAt;
  82.         return $this;
  83.     }
  84.     public function getUpdatedAt(): ?\DateTimeImmutable
  85.     {
  86.         return $this->updatedAt;
  87.     }
  88.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  89.     {
  90.         $this->updatedAt $updatedAt;
  91.         return $this;
  92.     }
  93. }