src/Entity/ExceptionLog.php line 21

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use ApiPlatform\Metadata\Get;
  5. use ApiPlatform\Metadata\Post;
  6. use App\Dto\ExceptionInput;
  7. use App\Repository\ExceptionLogRepository;
  8. use App\State\ExceptionLogProcessor;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. use Symfony\Component\Validator\Constraints\Length;
  13. #[ApiResource(operations: [
  14.     new Get(openapifalse),
  15.     new Post(inputExceptionInput::class, processorExceptionLogProcessor::class),
  16. ], normalizationContext: ['groups' => ['read']])]
  17. #[ORM\Entity(repositoryClassExceptionLogRepository::class)]
  18. class ExceptionLog
  19. {
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     #[Groups(['read''write'])]
  24.     private ?int $id null;
  25.     #[ORM\ManyToOne]
  26.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  27.     private ?Update $update null;
  28.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  29.     #[Groups(['read''write'])]
  30.     private ?\DateTimeInterface $createdAt null;
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     private ?string $tracing null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     #[Length(max255)]
  35.     #[Groups(['read''write'])]
  36.     private ?string $errorName null;
  37.     #[ORM\Column(length128nullabletrue)]
  38.     #[Groups(['read''write'])]
  39.     private ?string $helpName null;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getUpdate(): ?Update
  45.     {
  46.         return $this->update;
  47.     }
  48.     public function setUpdate(?Update $update): self
  49.     {
  50.         $this->update $update;
  51.         return $this;
  52.     }
  53.     public function getCreatedAt(): ?\DateTimeInterface
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getTracing(): ?string
  63.     {
  64.         return $this->tracing;
  65.     }
  66.     public function setTracing(?string $tracing): self
  67.     {
  68.         $this->tracing $tracing;
  69.         return $this;
  70.     }
  71.     public function getErrorName(): ?string
  72.     {
  73.         return $this->errorName;
  74.     }
  75.     public function setErrorName(?string $errorName): self
  76.     {
  77.         $this->errorName $errorName;
  78.         return $this;
  79.     }
  80.     public function getHelpName(): ?string
  81.     {
  82.         return $this->helpName;
  83.     }
  84.     public function setHelpName(?string $helpName): self
  85.     {
  86.         $this->helpName $helpName;
  87.         return $this;
  88.     }
  89. }