id = $job->getId(); $this->data = $results; $this->status = $status; } } /** * Returns the ID of the Job * * @return string */ public function getId(): string { return $this->id; } /** * Returns the data of the Job * * @return string */ public function getData(): string { return $this->data; } /** * @return int * @noinspection PhpUnused */ public function getStatus(): int { return $this->status; } /** * Returns an array representation of the Job * * @return array */ public function toArray(): array { return [ 'type' => 'tamer_job_results', 'id' => $this->id, 'data' => $this->data, 'status' => $this->status ]; } /** * Constructs a Job from an array * * @param array $data * @return JobResults */ public static function fromArray(array $data): JobResults { $job = new JobResults(); $job->setId($data['id']); $job->setData($data['data']); $job->setStatus($data['status']); return $job; } /** * @param string $id */ protected function setId(string $id): void { $this->id = $id; } /** * @param string $data */ protected function setData(string $data): void { $this->data = $data; } /** * @param int|null $status */ protected function setStatus(?int $status): void { $this->status = $status; } }