src/Entity/Notification.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  6. class Notification
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length50)]
  13.     private $type;
  14.     #[ORM\Column(type'datetime')]
  15.     private $created_at;
  16.     #[ORM\Column(type'datetime'nullabletrue)]
  17.     private $read_at;
  18.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'notifications')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private $user;
  21.     #[ORM\ManyToOne(targetEntityPost::class, inversedBy'notifications')]
  22.     #[ORM\JoinColumn(nullabletrue)]
  23.     private $post;
  24.     #[ORM\ManyToOne(targetEntityPostComment::class)]
  25.     private $comment;
  26.     #[ORM\ManyToOne(targetEntityUser::class)]
  27.     private $initiator;
  28.     public function __construct()
  29.     {
  30.         $this->setCreatedAt(new \DateTime());
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getType(): ?string
  37.     {
  38.         return $this->type;
  39.     }
  40.     public function setType(string $type): self
  41.     {
  42.         $this->type $type;
  43.         return $this;
  44.     }
  45.     public function getCreatedAt(): ?\DateTimeInterface
  46.     {
  47.         return $this->created_at;
  48.     }
  49.     public function setCreatedAt(\DateTimeInterface $created_at): self
  50.     {
  51.         $this->created_at $created_at;
  52.         return $this;
  53.     }
  54.     public function getReadAt(): ?\DateTimeInterface
  55.     {
  56.         return $this->read_at;
  57.     }
  58.     public function setReadAt(?\DateTimeInterface $read_at): self
  59.     {
  60.         $this->read_at $read_at;
  61.         return $this;
  62.     }
  63.     public function getUser(): ?User
  64.     {
  65.         return $this->user;
  66.     }
  67.     public function setUser(?User $user): self
  68.     {
  69.         $this->user $user;
  70.         return $this;
  71.     }
  72.     public function getPost(): ?Post
  73.     {
  74.         return $this->post;
  75.     }
  76.     public function setPost(?Post $post): self
  77.     {
  78.         $this->post $post;
  79.         return $this;
  80.     }
  81.     public function getComment(): ?PostComment
  82.     {
  83.         return $this->comment;
  84.     }
  85.     public function setComment(?PostComment $comment): self
  86.     {
  87.         $this->comment $comment;
  88.         return $this;
  89.     }
  90.     public function getInitiator(): ?User
  91.     {
  92.         return $this->initiator;
  93.     }
  94.     public function setInitiator(?User $initiator): self
  95.     {
  96.         $this->initiator $initiator;
  97.         return $this;
  98.     }
  99. }