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