From f46b6d45de5c5ddf566969e27be5698bcb1b9c28 Mon Sep 17 00:00:00 2001 From: SVDIGITAL Date: Thu, 16 May 2024 14:04:56 +0200 Subject: [PATCH] Miglioramento controlli --- src/Models/Balance.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Models/Balance.php b/src/Models/Balance.php index 308d145..70beb42 100644 --- a/src/Models/Balance.php +++ b/src/Models/Balance.php @@ -34,10 +34,10 @@ class Balance extends GenericModel { protected function hydrateData( stdClass $data ) { $payload = $data->payload; - $this->Currency = is_null( $payload->currency ) ? null : (string)$payload->currency; - $this->AvailableBalance = is_null( $payload->availableBalance ) ? null : (float)$payload->availableBalance; - $this->AccountingBalance = is_null( $payload->accountingBalance ) ? null : (float)$payload->accountingBalance; - $this->CreditLine = is_null( $payload->creditLine ) ? null : (float)$payload->creditLine; + $this->Currency = ( !isset( $payload->currency ) or empty( $payload->currency ) ) ? null : (string)$payload->currency; + $this->AvailableBalance = ( !isset( $payload->availableBalance ) or is_null( $payload->availableBalance ) ) ? null : (float)$payload->availableBalance; + $this->AccountingBalance = ( !isset( $payload->accountingBalance ) or is_null( $payload->accountingBalance ) ) ? null : (float)$payload->accountingBalance; + $this->CreditLine = ( !isset( $payload->creditLine ) or is_null( $payload->creditLine ) ) ? null : (float)$payload->creditLine; }