diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index e6b778c7..fcd49749 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -701,11 +701,11 @@ class APIController extends Controller $cvs = $cust->getVehicles(); foreach ($cvs as $cv) { - $battery_id = ''; + $battery_id = null; if ($cv->getCurrentBattery() != null) $battery_id = $cv->getCurrentBattery()->getID(); - $wty_ex = ''; + $wty_ex = null; if ($cv->getWarrantyExpiration() != null) $wty_ex = $cv->getWarrantyExpiration()->format('Y-m-d'); @@ -721,7 +721,7 @@ class APIController extends Controller 'color' => $cv->getColor(), 'condition' => $cv->getStatusCondition(), 'fuel_type' => $cv->getFuelType(), - 'wty_code' => $cv->getWarrantyCode() ?? $cv->getWarrantyCode() : '', + 'wty_code' => $cv->getWarrantyCode(), 'wty_expire' => $wty_ex, 'curr_batt_id' => $battery_id, 'is_motolite' => $cv->hasMotoliteBattery() ? 1 : 0, @@ -1950,15 +1950,12 @@ class APIController extends Controller if (!(is_null($warranty->getBatteryModel()))) { $batt_model = $warranty->getBatteryModel()->getName(); } - if (!(is_null($warranty->getBatterySize()))) { $batt_size = $warranty->getBatterySize()->getName(); } - if (!(is_null($warranty->getSAPBattery()))) { $sap_batt = $warranty->getSAPBattery()->getID(); } - if (!(is_null($warranty->getDateClaim()))) { $claim_date = $warranty->getDateClaim()->format("d M Y"); } @@ -1968,7 +1965,7 @@ class APIController extends Controller $warr[] = [ 'id' => $warranty->getID(), - 'serial' => $warranty->getSerial() ?? $warranty->getSerial() : '', + 'serial' => $warranty->getSerial(), 'warranty_class' => $warranty->getWarrantyClass(), 'plate_number' => $warranty->getPlateNumber(), 'first_name' => $warranty->getFirstName(), @@ -1982,7 +1979,7 @@ class APIController extends Controller 'date_purchase' => $warranty->getDatePurchase()->format("d M Y"), 'date_expire' => $expiry_date, 'date_claim' => $claim_date, - 'claim_from' => $warranty->getClaimedFrom() ?? $warranty->getClaimedFrom() : '', + 'claim_from' => $warranty->getClaimedFrom(), 'is_activated' => $warranty->isActivated() ? 1 : 0, ];