Lazy loading workaround
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
1