Closed Aniruddh-J closed 3 years ago
Hi @Aniruddh-J
Not sure if this is what you are looking for, but the following code allows you to loop over array of objects.
$allContacts = $apiInstance->getContacts($xeroTenantId);
foreach($allContacts as $contact) {
echo($contact->getName());
}
Let us know if this answers your question.
@Aniruddh-J - I didn't hear back, so assuming this answered your question. Closing issue now :-)
Sorry for the late response. I was able to loop through the accounts just the way you looped through contacts in your code. :)
Hello,
Is it possible to get the list of accounts as an array instead of instances of
XeroAPI\XeroPHP\Models\Accounting\Accounts\Account
?Typecasting adds array of
*container
.Any suggestions?