Express Objects and their Subparts

Permalink 1 user found helpful
Hey all. I am sure there is a simple way of doing this but I can't seem to find it in the documentation.

I want to grab the Address attribute for an Express Entity but can't seem to figure out how to get the individual parts... address1, address2, city, etc. I am using...

echo $item->getEntry()->getMemberAddress();

but that just dumps everything into one string.

Any help greatly appreciated.
C

 
Chrouglas replied on at Permalink Reply
I found it. For future reference...

foreach ($result->getItems() as $item) {
   $value = $item->getEntry()->getMemberAddress();
   echo "<br>".$value->getAddress1();
   echo "<br>".$value->getAddress2();   
   echo "<br>".$value->getCity();   
   echo "<br>".$value->getStateProvince();   
   echo "<br>".$value->getCountry();      
   echo "<br>".$value->getPostalCode();
}
Chrouglas replied on at Permalink Reply
Also for future reference... if you want to sort by the address's sub-info (city, state, etc) you apparently just tack the sub-item (im sure there is a more correct name for that) onto the end of the parent in CamelCase.

where my attribute handle is 'member_address'
and I want to sort by state_province
$list->sortByMemberAddressStateProvince('asc');
ctuxboy replied on at Permalink Reply
That's very useful info.
Adding tot my favorites 😉
Thank you!