嗨,大家好:)我想從資源會議框中採取所有會議,但是當我試圖採取這樣的主題$ subject = $ event->主題它顯示名稱由誰開會被創建。 $ request-> ParentFolderIds-> DistinguishedFolderId-> Mailbox-> EmailAddress =「[email protected]」這是我如何選擇資源會議框的代碼。會議主題從資源郵箱PHP-EWS
我想借此滿足其他方式問題,我會很高興,如果你能幫助我:)
$request = new EWSType_FindItemType();
// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED
// to identify "soft deleted" items, i.e. not visible and not in the trash can.
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
// This identifies the set of properties to return in an item or folder response
$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
// Define the timeframe to load calendar items
$request->CalendarView = new EWSType_CalendarViewType();
$request->CalendarView->StartDate ='2014-03-28T15:00:00+04:00';// an ISO8601 date e.g. 2012-06-12T15:18:34+03:00 "Y-m-d\TH:i:sO"
$request->CalendarView->EndDate = '2015-03-28T15:00:00+04:00';// an ISO8601 date later than the above "Y-m-d\TH:i:sO"
// Only look in the "calendars folder"
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
$request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = "[email protected]";
// Send request
$response = $ews->FindItem($request);
// Loop through each item if event(s) were found in the timeframe specified
if ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){
$events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;
// $db_selected = mysql_select_db('meeting_room',$con);
// $res=mysql_query("SELECT ID FROM meeting");
// while($row = mysql_fetch_array($res)){
// echo $row['ID'];
// echo "<br>";
// }
foreach ($events as $event){
$id = $event->ItemId->Id;
$change_key = $event->ItemId->ChangeKey;
$start = $event->Start;
$end = $event->End;
$subject = $event->Subject;
$location = $event->Location;
由誰這個主題顯示會議的創建。我希望這個信息太多,但我想題目太大..請幫助:)
您的代碼看起來正確。你可以在你的'foreach'循環中使用print_r($ event);來驗證整個事件參數嗎?我現在唯一的其他建議是將DefaultShapeNamesType改爲$ request-> ItemShape-> BaseShape = EWSType_DefaultShapeNamesType :: ALL_PROPERTIES; – ThomasEllis