我正在尝试使用php-ews创建一个定期日历事件,文档在这方面非常有限。到目前为止,我已经得到了以下内容,我无法找到如何在每周一和周三重复发言。任何以前做过这件事或者知道如何帮助我的人都可以吗?
$request->Items->CalendarItem->Recurrence = new Type\RecurrenceType();
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence = new Type\IntervalRecurrencePatternBaseType();
$request->Items->CalendarItem->Recurrence->NumberedRecurrence = new Type\NumberedRecurrenceRangeType();
$request->Items->CalendarItem->Recurrence->NumberedRecurrence->NumberOfOccurrences = 2;
$request->Items->CalendarItem->Recurrence->NumberedRecurrence->StartDate = //start date here;
答案 0 :(得分:2)
我已经成功使用了这个......
// Set up recurrence days
$request->Items->CalendarItem->Recurrence = new EWSType_RecurrenceType();
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence = new EWSType_IntervalRecurrencePatternBaseType();
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence->Interval = 1;
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence->DaysOfWeek = new EWSType_ArrayOfStringsType();
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence->DaysOfWeek = array(EWSType_DayOfWeekType::MONDAY, EWSType_DayOfWeekType::WEDNESDAY, EWSType_DayOfWeekType::FRIDAY);
// Specify recurrence start and end
$request->Items->CalendarItem->Recurrence->EndDateRecurrence = new EWSType_EndDateRecurrenceRangeType();
$request->Items->CalendarItem->Recurrence->EndDateRecurrence->EndDate = '2014-05-30';
$request->Items->CalendarItem->Recurrence->EndDateRecurrence->StartDate = '2014-05-14';
看起来你只是错过了DaysOfWeek
数组项。根据您希望会议发生的日期根据需要调整阵列,当然也可以设置自己的开始和结束日期。我相信Interval
项目相当于1 =每周,2 =每隔一周等等,但我没有测试过。