This code:
function CheckOrderStartCount($OrderID)
{
global $pdo;
global $layer;
$apiskey = '';
$stmt = $pdo->prepare('SELECT * FROM orders WHERE OrderID = :OrderID');
$stmt->execute(array(
':OrderID' => $OrderID
));
if ($stmt->rowCount() == 1) {
$row = $stmt->fetch();
$start_count = $row['OrderStartCount'];
$ServiceOrderAPI = $layer->GetData('services', 'ServiceOrderAPI', 'ServiceID', $row['OrderServiceID']);
if (empty($row['OrderStartCount']) && !empty($ServiceOrderAPI)) {
$URL = str_replace('[OrderID]', $row['OrderAPIID'], $ServiceOrderAPI);
$URL = str_replace('[apiskey]', $apiskey, $URL);
$return = $layer->SendCurl($URL);
$resp = json_decode($return);
if (isset($resp) && property_exists($resp, 'start_count'))
$start_count = $resp->start_count;
$stmt = $pdo->prepare('UPDATE orders SET OrderStartCount = :OrderStartCount WHERE OrderID = :OrderID');
$stmt->execute(array(
':OrderStartCount' => $start_count,
':OrderID' => $OrderID
));
}
return $start_count;
} else {
return 0;
}
}
public function DeclarePrice($ProductPrice, $ProductDefaultQuantity, $ProductQuantity)
{
$ProductValue = $ProductPrice / $ProductDefaultQuantity;
return $ProductValue * $ProductQuantity;
}
Error "First parameter must either be an object or the name of an existing class on line 227": if (isset($resp) && property_exists($resp, 'start_count'))
How to solve this problem?