php-ews
php-ews copied to clipboard
Get multiple users delegated calendars
Hi! I was wondering if someone knew how to return the calendar from multiple users? The code below works if I have an array with only one optional user calendar, but I can't figure out how to get two or more users delegated calendars. Any ideas?
$api = API::withUsernameAndPassword($ews_server, $ews_username, $password);
$calendar = $api->getCalendar();
$items = $calendar->getCalendarItems(new DateTime('1:00 AM'), new DateTime('11:59 PM'), array (
'ParentFolderIds' => array (
'DistinguishedFolderId' => array (
'Id' => 'calendar',
'Mailbox' => array (
'EmailAddress' => '[email protected]'
)
)
)
));
I though maybe this would work, but it doesn't:
$api = API::withUsernameAndPassword($ews_server, $ews_username, $password);
$calendar = $api->getCalendar();
$items = $calendar->getCalendarItems(new DateTime('1:00 AM'), new DateTime('11:59 PM'), array (
'ParentFolderIds' => array (
'DistinguishedFolderId' => array (
'Id' => 'calendar',
'Mailbox' => array (
'EmailAddress' => '[email protected]',
'EmailAddress' => '[email protected]'
)
)
)
));