I am working with the Google Calendar API, trying to get the ids from the response object.
Here is the object.
Google_Service_Calendar_CalendarList Object
(
[collection_key:protected] => items
[internal_gapi_mappings:protected] => Array
(
)
[etag] => "1454629096373000"
[itemsType:protected] => Google_Service_Calendar_CalendarListEntry
[itemsDataType:protected] => array
[kind] => calendar#calendarList
[nextPageToken] =>
[nextSyncToken] => CIj2xtSj38oCEj1nY2FsL....
[modelData:protected] => Array
(
[items] => Array
(
[0] => Array
(
[kind] => calendar#calendarListEntry
[etag] => "145461934381000"
[id] => tbcv49j3eg@group.calendar.google.com
[summary] => Appointments
[timeZone] => America/Chicago
[colorId] => 24
[backgroundColor] => #a47ae2
[foregroundColor] => #000000
[selected] => 1
[accessRole] => reader
[defaultReminders] => Array
(
)
)
[1] => Array
(
[kind] => calendar#calendarListEntry
[etag] => "14546290978873000"
[id] => o6lkfgdovcv2r8@group.calendar.google.com
[summary] => Test Calendar
[timeZone] => America/Chicago
[colorId] => 14
[backgroundColor] => #9fe1e7
[foregroundColor] => #000000
[selected] => 1
[accessRole] => reader
[defaultReminders] => Array
(
)
)
)
)
So I did this to get them into an array.
foreach ($calendarList['items'] as $key => $value) {
$ids[] = $calendarList['items'][$key]['id'];
}
But I would like to reference them in a more Object oriented style like
$calendarList->items->
Can I do this somehow?