我已经尝试通过php api来获取日历事件,例如
$service = new Google_Service_Calendar( $client );
$arr_options = array(
'singleEvents' => true,
);
$calendarId = 'primary';
$results = $service->events->listEvents( $calendarId,
$arr_options );
$events = $results->getItems();
foreach( $events as $event ) {
'title' => $event->getSummary(),
recurrence=>$event->getrecurrence();
}
响应重复数组为空。
0 => array:18 [▼
"title" => "10th SEPTEMBER PROJECT DUPLICATE 1"
"recurrence" => null
]
下面是我的插入事件API
$event = new Google_Service_Calendar_Event();
$event->setSummary('Appointment');
$event->setLocation('Somewhere');
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime('2011-06-03T10:00:00.000-07:00');
$start->setTimeZone('America/Los_Angeles');
$event->setStart($start);
$end = new Google_Service_Calendar_EventDateTime();
$end->setDateTime('2011-06-03T10:25:00.000-07:00');
$end->setTimeZone('America/Los_Angeles');
$event->setEnd($end);
$event- >setRecurrence(array('RRULE:FREQ=WEEKLY;UNTIL=20110701T170000Z'));
$recurringEvent = $service->events->insert('primary', $event);
现在我需要将更新事件api与 复发
但是作为响应,重复数组为null。 请帮助我如何获取重复数组。