status = new ImportJobStatus(); $this->startedAt = microtime(true); $this->endedAt = null; $this->exception = null; $this->product = null; } public function getStatus(): ImportJobStatus { return $this->status; } public function setStatus(ImportJobStatus $status): void { $this->status = $status; } public function getStartedAt(): float { return $this->startedAt; } public function getEndedAt(): ?float { return $this->endedAt; } public function setEndedAt(float $endedAt): void { $this->endedAt = $endedAt; } public function getDuration(): ?float { if ($this->endedAt === null) { return null; } return $this->endedAt - $this->startedAt; } public function getException(): ?Throwable { return $this->exception; } public function setException(Throwable $exception): void { $this->exception = $exception; } public function getProduct(): ?ProductDTO { return $this->product; } public function setProduct(ProductDTO $product): void { $this->product = $product; } public function addLog(string $message): void { $this->log[] = $message; } public function getLog(): array { return $this->log; } }