src/Entity/Log.php line 129

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Entity(repositoryClass'App\Repository\LogRepository')]
  5. #[ORM\HasLifecycleCallbacks]
  6. class Log
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'datetime'nullabletrue)]
  13.     private \DateTime|\DateTimeInterface|null $createdAt null;
  14.     #[ORM\Column(type'integer'nullabletrue)]
  15.     private ?int $userId null;
  16.     #[ORM\Column(type'string'length45)]
  17.     private ?string $ip null;
  18.     #[ORM\Column(type'integer')]
  19.     private ?int $result null;
  20.     #[ORM\Column(type'json'nullabletrue)]
  21.     private ?array $response = [];
  22.     #[ORM\Column(type'integer')]
  23.     private ?int $size null;
  24.     #[ORM\Column(type'json'nullabletrue)]
  25.     private ?array $request null;
  26.     #[ORM\Column(type'integer'nullabletrue)]
  27.     private ?int $responseTime null;
  28.     #[ORM\Column(type'string'length255nullabletrue)]
  29.     private ?string $url null;
  30.     
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     private ?string $method null;
  33.     #[ORM\Column(type'text'nullabletrue)]
  34.     private ?string $exception null;
  35.     #[ORM\ManyToOne(targetEntityUserAgent::class, inversedBy'logs')]
  36.     private ?\App\Entity\UserAgent $userAgent null;
  37.     #[ORM\PrePersist]
  38.     public function onPrePersist()
  39.     {
  40.         $this->createdAt = new \DateTime("now");
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getCreatedAt(): ?\DateTimeInterface
  47.     {
  48.         return $this->createdAt;
  49.     }
  50.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  51.     {
  52.         $this->createdAt $createdAt;
  53.         return $this;
  54.     }
  55.     public function getUserId(): ?int
  56.     {
  57.         return $this->userId;
  58.     }
  59.     public function setUserId(?int $userId): self
  60.     {
  61.         $this->userId $userId;
  62.         return $this;
  63.     }
  64.     public function getIp(): ?string
  65.     {
  66.         return $this->ip;
  67.     }
  68.     public function setIp(string $ip): self
  69.     {
  70.         $this->ip $ip;
  71.         return $this;
  72.     }
  73.     public function getResult(): ?int
  74.     {
  75.         return $this->result;
  76.     }
  77.     public function setResult(int $result): self
  78.     {
  79.         $this->result $result;
  80.         return $this;
  81.     }
  82.     public function getResponse(): ?array
  83.     {
  84.         return $this->response;
  85.     }
  86.     public function setResponse(?array $response): self
  87.     {
  88.         $this->response $response;
  89.         return $this;
  90.     }
  91.     public function getSize(): ?int
  92.     {
  93.         return $this->size;
  94.     }
  95.     public function setSize(int $size): self
  96.     {
  97.         $this->size $size;
  98.         return $this;
  99.     }
  100.     public function getRequest(): ?array
  101.     {
  102.         return $this->request;
  103.     }
  104.     public function setRequest(?array $request): self
  105.     {
  106.         $this->request $request;
  107.         return $this;
  108.     }
  109.     public function getResponseTime(): ?int
  110.     {
  111.         return $this->responseTime;
  112.     }
  113.     public function setResponseTime(?int $responseTime): self
  114.     {
  115.         $this->responseTime $responseTime;
  116.         return $this;
  117.     }
  118.     public function getUrl(): ?string
  119.     {
  120.         return $this->url;
  121.     }
  122.     public function setUrl(?string $url): self
  123.     {
  124.         $this->url $url;
  125.         return $this;
  126.     }
  127.     
  128.     public function getMethod(): ?string
  129.     {
  130.         return $this->method;
  131.     }
  132.     public function setMethod(?string $method): self
  133.     {
  134.         $this->method $method;
  135.         return $this;
  136.     }
  137.     public function getException(): ?string
  138.     {
  139.         return $this->exception;
  140.     }
  141.     public function setException(?string $exception): self
  142.     {
  143.         $this->exception $exception;
  144.         return $this;
  145.     }
  146.     public function getUserAgent(): ?UserAgent
  147.     {
  148.         return $this->userAgent;
  149.     }
  150.     public function setUserAgent(?UserAgent $userAgent): self
  151.     {
  152.         $this->userAgent $userAgent;
  153.         return $this;
  154.     }
  155. }