stdclass could not convert int error Laravel 8

Viewed 22

Client ->

public function GetProductByProductId($productId)
{
    $this->setUrl('https://api.example.com/ws/ProductService.wsdl');
    self::$_parameters['productId'] = $productId;
    return self::$_sclient->GetProductByProductId(self::$_parameters);
}

Controller ->

$service_id = 100;
$productsRaw = $serviceClient->GetProductList();
foreach($productsRaw as $productId){
   $prd = (new serviceClient($service_id))->GetProductByProductId($productId->id);
   if ($prd->result->status == 'failure') {
       $prd = new stdClass();
       $prd->title = $productId->productName;
       ...ect
       $prd->save();
   }
}

I keep getting the error "Object of class stdClass could not be converted to int in"

0 Answers
Related