src/Entity/BatchResultItem.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BatchResultItemRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. #[ORM\Entity(repositoryClassBatchResultItemRepository::class)]
  8. class BatchResultItem
  9. {
  10.     use TimestampableEntity;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne(inversedBy'batchResultItems')]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?BatchResult $batchResult null;
  18.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  19.     private ?string $data null;
  20.     public function getId(): ?int
  21.     {
  22.         return $this->id;
  23.     }
  24.     public function getBatchResult(): ?BatchResult
  25.     {
  26.         return $this->batchResult;
  27.     }
  28.     public function setBatchResult(?BatchResult $batchResult): static
  29.     {
  30.         $this->batchResult $batchResult;
  31.         return $this;
  32.     }
  33.     public function getData(): ?string
  34.     {
  35.         return $this->data;
  36.     }
  37.     public function setData(?string $data): static
  38.     {
  39.         $this->data $data;
  40.         return $this;
  41.     }
  42.     // add to string
  43.     public function __toString()
  44.     {
  45.         return sprintf('%s - %s'$this->getCreatedAt()->format('Y-m-d H:i:s'), $this->getData());
  46.     }
  47. }