I am trying to get the address field datas in SocialEngine.
I get the current user by:
$viewer = Engine_Api::_()->user()->getViewer();
I can get the fields array by the following:
$fields = Engine_Api::_()->fields()->getFieldsValuesByAlias($viewer);
which returns:
Array (
[profile_type] => 23
[first_name] => firstname
[last_name] => lastname
[birthdate] => 1994-1-1
[gender] => 8
[website] => www.website.com )
Which object do I have to call to get the current user Address fields, such as City,State, ZIP code etc.?
I assume you’ve added city, state, zip fields etc. from control panel. You need to edit
engine4_user_fields_metatable in database and manually add alias for those custom fields.