title: How to read the contact data as returned by the Google People API using PHP
body: <p>I am new to the google API and would like to use the People API for obtaining all the contacts of a user. 
  It works, I can authenticate the user and I call the People API as follows:</p>
  
  <pre><code>$contacts = $peopleService-&gt;people_connections-&gt;listPeopleConnections('people/me');
    foreach ($contacts as $contactItem) {
    $this-&gt;print_r2($contactItem);
    } 
  </code></pre>
  
  <p>But I obtain an object of type Google_Service_People_ListConnectionsResponse:</p>
  
  <pre><code>Google_Service_People_ListConnectionsResponse Object
  (
  [collection_key:protected] =&gt; connections
  [internal_gapi_mappings:protected] =&gt; Array
      (
      )
  
  [connectionsType:protected] =&gt; Google_Service_People_Person
  [connectionsDataType:protected] =&gt; array
  [nextPageToken] =&gt; 
  [nextSyncToken] =&gt; CPDp4aW_KhIBMRjuEioECAAQAQ
  [modelData:protected] =&gt; Array
      (
          [connections] =&gt; Array
              (
                  [0] =&gt; Array
                      (
                          [resourceName] =&gt; people/c3422388075840417635
                          [etag] =&gt; AgD+4rTZF6o=
                          [metadata] =&gt; Array
                              (
                                  [sources] =&gt; Array
                                      (
                                          [0] =&gt; Array
                                              (
                                                  [type] =&gt; CONTACT
                                                  [id] =&gt; 2fc3d288898002f63
                                                  [etag] =&gt; #AgD+4rTZF6o=
                                              )
  
                                      )
  
                                  [deleted] =&gt; 1
                                  [objectType] =&gt; PERSON
                              )
  
                      )
  
                  [1] =&gt; Array
                      (
                          [resourceName] =&gt; people/107483842333347794768
                          [etag] =&gt; btQbbIVcGJ4=
                          [metadata] =&gt; Array
                              (
                                  [sources] =&gt; Array
                                      (
                                          [0] =&gt; Array
                                              (
                                                  [type] =&gt; CONTACT
                                                  [id] =&gt; 715e58866e51e374
                                                  [etag] =&gt; #TW+s5999ANk=
                                              )
  
                                          [1] =&gt; Array
                                              (
                                                  [type] =&gt; PROFILE
                                                  [id] =&gt; 107483842299147794768
                                              )
  
                                      )
  
                                  [objectType] =&gt; PERSON
                              )
  
                          [names] =&gt; Array
                              (
                                  [0] =&gt; Array
                                      (
                                          [metadata] =&gt; Array
                                              (
                                                  [primary] =&gt; 1
                                                  [source] =&gt; Array
                                                      (
                                                          [type] =&gt; CONTACT
                                                          [id] =&gt; 715e50000e51e374
                                                      )
  
                                              )
  
                                          [displayName] =&gt; xxxxxxxx
                                          [familyName] =&gt; xxxxxx
                                          [givenName] =&gt; xxxxxxxxx
                                          [displayNameLastFirst] =&gt; xxxxx, xxxxx
                                      )
  
                                  [1] =&gt; Array
                                      (
                                          [metadata] =&gt; Array
                                              (
                                                  [source] =&gt; Array
                                                      (
                                                          [type] =&gt; PROFILE
                                                          [id] =&gt; *************************
                                                      )
  
                                              )
  
                                          [displayName] =&gt; xxxxxxxxxx
                                          [familyName] =&gt; xxxxx
                                          [givenName] =&gt; xxxxxxx
                                          [displayNameLastFirst] =&gt; xxxxx, xxxxxxx
                                      )
  
                              )
  </code></pre>
  
  <p>... .  ..... ...</p>
  
  <p>My question is kinda stupid: how do I read, using the PHP client library, the [modelData:protected] array so I can the resulting [connections].</p>