id = $data['id'] ?? null; $dto->stepNumber = isset($data['stepNumber']) ? (int)$data['stepNumber'] : null; $dto->title = $data['title'] ?? null; $dto->instruction = $data['instruction'] ?? null; $dto->image = $data['image'] ?? null; $dto->timeEstimate = isset($data['timeEstimate']) ? (int)$data['timeEstimate'] : null; $dto->sortOrder = isset($data['sortOrder']) ? (int)$data['sortOrder'] : null; return $dto; } /** * Convert DTO to array * * @return array */ public function toArray(): array { return [ 'id' => $this->id, 'stepNumber' => $this->stepNumber, 'title' => $this->title, 'instruction' => $this->instruction, 'image' => $this->image, 'timeEstimate' => $this->timeEstimate, 'sortOrder' => $this->sortOrder, ]; } }