I want to get a list of shared (not primary or resource) Calendars through Google Calendar API for PHP. I tried the following:
(...)
$service = new Google_Service_Calendar($client);
(...)
$calendarList = $service->calendarList->listCalendarList();
I get three types of results in Array/Object
[id] => code@subdomain.domain.ext
- Primary Calendar, username@domain.ext
- Shared Calendar, code@group.calendar.google.com
- Resource Calendar, code@resource.calendar.google.com
These are only distinguishable by their $key (id) and I could filter Shared Calendar by $value "group.calendar.google.com" however I think this can be done with more clean coding or by using a built-in method.
Is there any other way to only get Shared Calendars?