src/Entity/DocapostLog.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocapostLogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: DocapostLogRepository::class)]
  6. #[ORM\HasLifecycleCallbacks]
  7. class DocapostLog
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type: 'integer')]
  12.     private ?int $id = null;
  13.     #[ORM\Column(type: 'string', length: 255)]
  14.     private ?string $endpoint = null;
  15.     #[ORM\Column(type: 'json')]
  16.     private array $request = [];
  17.     #[ORM\Column(type: 'integer')]
  18.     private ?int $response_code = null;
  19.     #[ORM\Column(type: 'json')]
  20.     private array $response = [];
  21.     #[ORM\Column(type: 'datetime')]
  22.     private ?\DateTimeInterface $createdAt = null;
  23.     #[ORM\PrePersist]
  24.     public function updatedTimestamps(): void
  25.     {
  26.         if (null === $this->getCreatedAt()) {
  27.             $this->setCreatedAt(new \DateTime());
  28.         }
  29.     }
  30.     public function getRequestString(): false|string
  31.     {
  32.         return json_encode($this->request);
  33.     }
  34.     public function getResponseString(): false|string
  35.     {
  36.         return json_encode($this->response);
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getEndpoint(): ?string
  43.     {
  44.         return $this->endpoint;
  45.     }
  46.     public function setEndpoint(string $endpoint): self
  47.     {
  48.         $this->endpoint = $endpoint;
  49.         return $this;
  50.     }
  51.     public function getRequest(): ?array
  52.     {
  53.         return $this->request;
  54.     }
  55.     public function setRequest(array $request): self
  56.     {
  57.         $this->request = $request;
  58.         return $this;
  59.     }
  60.     public function getResponseCode(): ?int
  61.     {
  62.         return $this->response_code;
  63.     }
  64.     public function setResponseCode(int $response_code): self
  65.     {
  66.         $this->response_code = $response_code;
  67.         return $this;
  68.     }
  69.     public function getResponse(): ?array
  70.     {
  71.         return $this->response;
  72.     }
  73.     public function setResponse(array $response): self
  74.     {
  75.         $this->response = $response;
  76.         return $this;
  77.     }
  78.     public function getCreatedAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->createdAt;
  81.     }
  82.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  83.     {
  84.         $this->createdAt = $createdAt;
  85.         return $this;
  86.     }
  87. }