Normally you would access the address and transaction price as:
foreach( $yourArray[0]->_transactions as $transaction ) {
$foo = $transaction->accountName;
$bar = $transaction->price;
}
But in this particular case, some of your fields are private, meaning that you can't access their value directly. You could try defining your own Statement_banking
and Transaction_banking
classes and define accessor methods for those fields, such as:
public class Statement_banking {
public function getTransactions() {
return $this->_transactions;
}
}
public class Transaction_banking {
public function getAccountName() {
return $this->accountName;
}
public function getPrice() {
return $this->price;
}
}
Then your loop code becomes this:
foreach( $yourArray[0]->getTransactions() as $transaction ) {
$foo = $transaction->getAccountName();
$bar = $transaction->getPrice();
}
If you want to iterate over the outer array as well, you can expand it to:
foreach( $yourArray as $statement ) {
foreach( $statement->getTransactions() as $transaction ) {
$foo = $transaction->getAccountName();
$bar = $transaction->getPrice();
}
}