src/Entity/JobEvents.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JobEventsRepository;
  4. use DateTime;
  5. use DateTimeInterface;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=JobEventsRepository::class)
  9.  */
  10. class JobEvents
  11. {
  12.     public const STATUS_TO_TREAT                    1;
  13.     public const STATUS_TREATMENT_IN_PROGRESS       2;
  14.     public const STATUS_TREATED                     3;
  15.     public const STATUS_ERROR                       99;
  16.     public const STATUS_LABEL = [
  17.         self::STATUS_TO_TREAT                       => 'To treat',
  18.         self::STATUS_TREATMENT_IN_PROGRESS          => 'Treatment in progress',
  19.         self::STATUS_TREATED                        => 'Treated',
  20.         self::STATUS_ERROR                          => 'Error',
  21.     ];
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="integer")
  30.      */
  31.     private $status;
  32.     /**
  33.      * @ORM\Column(type="text", nullable=true)
  34.      */
  35.     private $message;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=Job::class, inversedBy="jobEvents")
  38.      * @ORM\JoinColumn(nullable=false)
  39.      */
  40.     private $job;
  41.     /**
  42.      * @ORM\Column(type="datetime")
  43.      */
  44.     private $createdAt;
  45.     /**
  46.      * @ORM\Column(type="datetime", nullable=true)
  47.      */
  48.     private $updatedAt;
  49.     /**
  50.      * @ORM\Column(type="json", nullable=true)
  51.      */
  52.     private $errorTrace;
  53.     /**
  54.      * @ORM\Column(type="text", nullable=true)
  55.      */
  56.     private $errorMessage;
  57.     /**
  58.      * @ORM\Column(type="text", nullable=true)
  59.      */
  60.     private $errorScriptLog;
  61.     public function __construct()
  62.     {
  63.         $this->createdAt = new DateTime();
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getStatus(): ?int
  70.     {
  71.         return $this->status;
  72.     }
  73.     public function setStatus(int $status): self
  74.     {
  75.         $this->status $status;
  76.         return $this;
  77.     }
  78.     public function getMessage(): ?string
  79.     {
  80.         return $this->message;
  81.     }
  82.     public function setMessage(?string $message): self
  83.     {
  84.         $this->message $message;
  85.         return $this;
  86.     }
  87.     public function getJob(): ?Job
  88.     {
  89.         return $this->job;
  90.     }
  91.     public function setJob(?Job $job): self
  92.     {
  93.         $this->job $job;
  94.         return $this;
  95.     }
  96.     public function getCreatedAt(): ?DateTimeInterface
  97.     {
  98.         return $this->createdAt;
  99.     }
  100.     public function setCreatedAt(DateTimeInterface $createdAt): self
  101.     {
  102.         $this->createdAt $createdAt;
  103.         return $this;
  104.     }
  105.     public function getUpdatedAt(): ?DateTimeInterface
  106.     {
  107.         return $this->updatedAt;
  108.     }
  109.     public function setUpdatedAt(?DateTimeInterface $updatedAt): self
  110.     {
  111.         $this->updatedAt $updatedAt;
  112.         return $this;
  113.     }
  114.     public function getErrorTrace(): ?array
  115.     {
  116.         return $this->errorTrace;
  117.     }
  118.     public function setErrorTrace(?array $errorTrace): self
  119.     {
  120.         $this->errorTrace $errorTrace;
  121.         return $this;
  122.     }
  123.     public function getErrorMessage(): ?string
  124.     {
  125.         return $this->errorMessage;
  126.     }
  127.     public function setErrorMessage(?string $errorMessage): self
  128.     {
  129.         $this->errorMessage $errorMessage;
  130.         return $this;
  131.     }
  132.     public function getErrorScriptLog(): ?string
  133.     {
  134.         return $this->errorScriptLog;
  135.     }
  136.     public function setErrorScriptLog(?string $errorScriptLog): self
  137.     {
  138.         $this->errorScriptLog $errorScriptLog;
  139.         return $this;
  140.     }
  141. }