I have the following variable:
var_dump($bankAccount);
What prints:
object (PayMe \ Sdk \ BankAccount \ BankAccount) # 35 (11) { ["id": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
int (17929453)
["bankCode": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (3) "104"
["agency": "Pay Me \ Sdk \ BankAccount \ BankAccount": private] = >
string (4) "0000"
["DV Agent": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
NULL ["account": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (5) "12345"
["accountDv": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (1) "5"
["documentNumber": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = > string (11) "04900000000"
["documentType": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (3) "cpf"
["legalName": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (12) "Maykel Esser"
["dateCreated": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
object (DateTime) # 37 (3) { ["date"] = > string (26) "2019-01-02 20: 03: 14.031000" ["timezone_type"] = > int (2) ["timezone"] = > string (1) "Z"} ["type": "PayMe \ Sdk \ BankAccount \ BankAccount": private] = >
string (14) "account_current"}
That is, the return of the $ bankAccount var_dump is an object. I need the ID that is inside this object, and save it in a variable for later use.
I tried to pull it this way:
$idBanco = $bankAccount->id;
But I got the error:
Fatal error : Uncaught Error: Can not access private property PayMe \ Sdk \ BankAccount \ BankAccount :: $ id
How to proceed?