src/services/People.php
public static function getSimpleContacts()
    {
        $contactObj = self::listPeopleConnections();

        // Parser
        $contacts = [];
            
        if (count($contactObj->getConnections()) != 0) {
            
            foreach ($contactObj->getConnections() as $person) {

                // var_dump($person);exit;
                $data = [];
                // Resource name
                $data['id'] = $person->getResourceName();
                $data['name'] = isset($person->getNames()[0]) 
                    ? $person->getNames()[0]->getDisplayName() 
                    : null;
                $data['email'] = isset($person->getEmailAddresses()[0]) 
                    ? $person->getEmailAddresses()[0]->getValue() 
                    : null;
                $data['phone'] = isset($person->getPhoneNumbers()[0]) 
                    ? $person->getPhoneNumbers()[0]->getValue() 
                    : null;

                $contacts[] = $data;
            }
        }
        
        return $contacts;
    }
public static function getSimpleContacts()
    {
        $contactObj = self::listPeopleConnections();

        // Parser
        $contacts = [];
            
        if (count($contactObj->getConnections()) != 0) {
            
            foreach ($contactObj->getConnections() as $person) {

                // var_dump($person);exit;
                $data = [];
                // Resource name
                $data['id'] = $person->getResourceName();
                $data['name'] = isset($person->getNames()[0]) 
                    ? $person->getNames()[0]->getDisplayName() 
                    : null;
                $data['email'] = isset($person->getEmailAddresses()[0]) 
                    ? $person->getEmailAddresses()[0]->getValue() 
                    : null;
                $data['phone'] = isset($person->getPhoneNumbers()[0]) 
                    ? $person->getPhoneNumbers()[0]->getValue() 
                    : null;

                $contacts[] = $data;
            }
        }
        
        return $contacts;
    }
public static function getSimpleContacts ( ) { $ contactObj = self :: listPeopleConnections ( ) ; // Parser
 $ contacts = [ ] ; if ( count ( $ contactObj -> getConnections ( ) ) != 0 ) { foreach ( $ contactObj -> getConnections ( ) as $ person ) { // var_dump($person);exit;
 $ data = [ ] ; // Resource name
 $ data [ 'id' ] = $ person -> getResourceName ( ) ; $ data [ 'name' ] = isset ( $ person -> getNames ( ) [ 0 ] ) ? $ person -> getNames ( ) [ 0 ] -> getDisplayName ( ) : null ; $ data [ 'email' ] = isset ( $ person -> getEmailAddresses ( ) [ 0 ] ) ? $ person -> getEmailAddresses ( ) [ 0 ] -> getValue ( ) : null ; $ data [ 'phone' ] = isset ( $ person -> getPhoneNumbers ( ) [ 0 ] ) ? $ person -> getPhoneNumbers ( ) [ 0 ] -> getValue ( ) : null ; $ contacts [ ] = $ data ; } } return $ contacts ; }
Get simple contact data with parser

@return array Contacts
Get simple contact data with parser