src/Entity/Delete/Reporting/OpsReport.php line 21

  1. <?php
  2. namespace App\Entity\Delete\Reporting;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use DateTimeInterface;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Table(name'reporting_ops')]
  10. #[ORM\Entity]
  11. #[ApiResource(
  12.     shortName'Ops',
  13.     routePrefix'/reporting',
  14.     order: ['id' => 'DESC'],
  15.     paginationClientEnabledfalse,
  16.     paginationItemsPerPage1
  17. )]
  18. class OpsReport
  19. {
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  22.     #[ORM\SequenceGenerator(sequenceName'reporting_ops_id_seq')]
  23.     #[ORM\Column(typeTypes::INTEGER)]
  24.     private int $id;
  25.     #[Gedmo\Timestampable(on'create')]
  26.     #[Assert\Type(typeDateTimeInterface::class)]
  27.     #[ORM\Column(typeTypes::DATETIMETZ_MUTABLEoptions: ['default' => 'CURRENT_TIMESTAMP'])]
  28.     protected ?DateTimeInterface $createdAt null;
  29.     #[Assert\Valid]
  30.     #[Assert\Type(typeOpsReportData::class)]
  31.     #[ORM\Column(type'json_document'options: ['jsonb' => true])]
  32.     protected OpsReportData $data;
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getCreatedAt(): ?DateTimeInterface
  38.     {
  39.         return $this->createdAt;
  40.     }
  41.     public function setCreatedAt(?DateTimeInterface $createdAt): static
  42.     {
  43.         $this->createdAt $createdAt;
  44.         return $this;
  45.     }
  46.     public function getData(): ?OpsReportData
  47.     {
  48.         return $this->data;
  49.     }
  50.     public function setData(?OpsReportData $data): static
  51.     {
  52.         $this->data $data;
  53.         return $this;
  54.     }
  55. }