src/Entity/Notification.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  7. #[ORM\Table(name'notifications'), ORM\Index(name'idx_notifications_users'columns: ['user_id'])]
  8. class Notification
  9. {
  10.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length12)]
  13.     private $type;
  14.     #[ORM\Column(type'string')]
  15.     private $message;
  16.     #[ORM\Column(type'boolean')]
  17.     private bool $isRead false;
  18.     #[ORM\ManyToOne(targetEntityUser::class), ORM\JoinColumn(nullablefalse)]
  19.     private $user;
  20.     #[Gedmo\Timestampable(on'create'), ORM\Column(type'datetime')]
  21.     private $createdAt;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getType(): ?string
  27.     {
  28.         return $this->type;
  29.     }
  30.     public function setType(string $type): self
  31.     {
  32.         $this->type $type;
  33.         return $this;
  34.     }
  35.     public function getMessage(): ?string
  36.     {
  37.         return $this->message;
  38.     }
  39.     public function setMessage(string $message): self
  40.     {
  41.         $this->message $message;
  42.         return $this;
  43.     }
  44.     public function getIsRead(): ?bool
  45.     {
  46.         return $this->isRead;
  47.     }
  48.     public function setIsRead(bool $isRead): self
  49.     {
  50.         $this->isRead $isRead;
  51.         return $this;
  52.     }
  53.     public function getUser(): ?User
  54.     {
  55.         return $this->user;
  56.     }
  57.     public function setUser(?User $user): self
  58.     {
  59.         $this->user $user;
  60.         return $this;
  61.     }
  62.     public function getCreatedAt(): ?\DateTimeInterface
  63.     {
  64.         return $this->createdAt;
  65.     }
  66. }