I don't think that the GetRooms
method was ever added to php-ews. It seems they just quit development.
see.. https://github.com/jamesiarmes/php-ews/issues/91
As a workaround, if your rooms exist in Active Directory, you could do an LDAP query to get the rooms and then loop through each room using the email address of the room to get it's calendar with php-ews. Otherwise, you could possibly maintain a db list of the rooms with their email addresses and pull them that way before looping.
Once you have the rooms' email addresses, you'd use Exchange impersonation, impersonating the email of the room to check it's calendar.
Something like this...
// Configure impersonation using the conference OwnerEmailAddress
$ei = new EWSType_ExchangeImpersonationType();
$sid = new EWSType_ConnectingSIDType();
$sid->PrimarySmtpAddress = $email;
$ei->ConnectingSID = $sid;
$ews->setImpersonation($ei);
// Set the search for calendar item types
$request = new EWSType_FindItemType();
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;
$request->CalendarView = new EWSType_CalendarViewType();
// Set the instance start and end times
$request->CalendarView->StartDate = $start->format('Y-m-d\TH:i:s');
$request->CalendarView->EndDate = $end->format('Y-m-d\TH:i:s');
// Set the search location as the calendars folder of the impersonated user
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
$request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = $email;
// Execute the search
$response = $ews->FindItem($request);
where you supply the $email
and $start
and $end
. NOTE: the account you access the EWS API with will require impersonation privileges.
Good luck.