src/Entity/UserNotification.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserNotificationRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Traits\Timestampable;
  7. use JMS\Serializer\Annotation\Groups;
  8. #[ORM\HasLifecycleCallbacks]
  9. #[ORM\Entity(repositoryClassUserNotificationRepository::class)]
  10. class UserNotification
  11. {
  12.     use Timestampable;
  13.     
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups(["getUserNotification"])]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     #[Groups(["getUserNotification"])]
  21.     private ?string $title null;
  22.     #[ORM\Column(length255)]
  23.     #[Groups(["getUserNotification"])]
  24.     private ?string $content null;
  25.     #[ORM\ManyToOne(inversedBy'userNotifications')]
  26.     #[ORM\JoinColumn(nullablefalse)]
  27.     #[Groups(["getUserNotification"])]
  28.     private ?User $user null;
  29.     #[ORM\Column(length255)]
  30.     #[Groups(["getUserNotification"])]
  31.     private ?string $type null;
  32.     #[ORM\Column(nullabletrue)]
  33.     #[Groups(["getUserNotification"])]
  34.     private ?int $dataId null;
  35.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  36.     #[Groups(["getUserNotification"])]
  37.     private ?array $data null;
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getTitle(): ?string
  43.     {
  44.         return $this->title;
  45.     }
  46.     public function setTitle(string $title): static
  47.     {
  48.         $this->title $title;
  49.         return $this;
  50.     }
  51.     public function getContent(): ?string
  52.     {
  53.         return $this->content;
  54.     }
  55.     public function setContent(string $content): static
  56.     {
  57.         $this->content $content;
  58.         return $this;
  59.     }
  60.     public function getUser(): ?User
  61.     {
  62.         return $this->user;
  63.     }
  64.     public function setUser(?User $user): static
  65.     {
  66.         $this->user $user;
  67.         return $this;
  68.     }
  69.     public function getType(): ?string
  70.     {
  71.         return $this->type;
  72.     }
  73.     public function setType(string $type): static
  74.     {
  75.         $this->type $type;
  76.         return $this;
  77.     }
  78.     public function getDataId(): ?int
  79.     {
  80.         return $this->dataId;
  81.     }
  82.     public function setDataId(?int $dataId): static
  83.     {
  84.         $this->dataId $dataId;
  85.         return $this;
  86.     }
  87.     public function getData(): ?array
  88.     {
  89.         return $this->data;
  90.     }
  91.     public function setData(?array $data): static
  92.     {
  93.         $this->data $data;
  94.         return $this;
  95.     }
  96. }