src/Log/Entity/AuditLog.php line 11

Open in your IDE?
  1. <?php
  2. namespace PaperKite\Log\Entity;
  3. use DateTimeImmutable;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use PaperKite\Log\Repository\AuditLogRepository;
  7. #[ORM\Entity(repositoryClassAuditLogRepository::class)]
  8. class AuditLog
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(typeTypes::TEXT)]
  15.     private ?string $message null;
  16.     #[ORM\Column(typeTypes::JSON)]
  17.     private array $context = [];
  18.     #[ORM\Column(typeTypes::SMALLINT)]
  19.     private ?int $level null;
  20.     #[ORM\Column(length50)]
  21.     private ?string $levelName null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $channel null;
  24.     #[ORM\Column(typeTypes::JSON)]
  25.     private array $extra = [];
  26.     #[ORM\Column]
  27.     private ?DateTimeImmutable $createdAt null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $user null;
  30.     public function __construct()
  31.     {
  32.         $this->createdAt = new DateTimeImmutable();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getMessage(): ?string
  39.     {
  40.         return $this->message;
  41.     }
  42.     public function setMessage(string $message): self
  43.     {
  44.         $this->message $message;
  45.         return $this;
  46.     }
  47.     public function getContext(): array
  48.     {
  49.         return $this->context;
  50.     }
  51.     public function setContext(array $context): self
  52.     {
  53.         $this->context $context;
  54.         return $this;
  55.     }
  56.     public function getLevel(): ?int
  57.     {
  58.         return $this->level;
  59.     }
  60.     public function setLevel(int $level): self
  61.     {
  62.         $this->level $level;
  63.         return $this;
  64.     }
  65.     public function getLevelName(): ?string
  66.     {
  67.         return $this->levelName;
  68.     }
  69.     public function setLevelName(string $levelName): self
  70.     {
  71.         $this->levelName $levelName;
  72.         return $this;
  73.     }
  74.     public function getChannel(): ?string
  75.     {
  76.         return $this->channel;
  77.     }
  78.     public function setChannel(string $channel): self
  79.     {
  80.         $this->channel $channel;
  81.         return $this;
  82.     }
  83.     public function getExtra(): array
  84.     {
  85.         return $this->extra;
  86.     }
  87.     public function setExtra(array $extra): self
  88.     {
  89.         $this->extra $extra;
  90.         return $this;
  91.     }
  92.     public function getCreatedAt(): ?DateTimeImmutable
  93.     {
  94.         return $this->createdAt;
  95.     }
  96.     public function setCreatedAt(DateTimeImmutable $createdAt): self
  97.     {
  98.         $this->createdAt $createdAt;
  99.         return $this;
  100.     }
  101.     public function getUser(): ?string
  102.     {
  103.         return $this->user;
  104.     }
  105.     public function setUser(?string $user): self
  106.     {
  107.         $this->user $user;
  108.         return $this;
  109.     }
  110. }