You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Lazy loading workaround

Received Response
24
Views
1
Comments
edited Nov 6, 2019 10:33AM in Customer Portal 1 comment

Content

Hi,

I have the following code which I know won't work but I was hoping someone had a simpler solution - for a contact that is logged in, I want to expose all their custom field values and dump them into an array called $a

RNCPHP\ConnectAPI::getCurrentContext()->ApplicationContext = "Get contact information";
$a = Array();
$contact = json_encode($this->CI->session->getProfile(), true);
$contact = json_decode($contact, true);
$uid = $contact['c_id']['value'];
$contact = RNCPHP\Contact::fetch($uid);
 
foreach ($contact->CustomFields->c as $k) {
$a[$k] = $contact->CustomFields->c->$k;
}
Any advice would be welcome
 
I've tried curly brackets but this goes nowhere

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!