使用Zend Google数据api添加具有与会者/访客值的Google日历事件


Using Zend Google data api to add Google Calendar event with attendee/guest value

我正试图在zend-google数据api上用php制作一个privat应用程序。我需要从脚本中创建事件。我面临的问题是,我无法从活动脚本中添加嘉宾/与会者/参与者。实际上我找不到正确的参数。我正在使用的功能:

function createEvent ($client, $title = 'Tennis with Beth',
    $desc='Meet for a quick lesson', $where = 'On the courts',
    $startDate = '2008-01-20', $startTime = '10:00',
    $endDate = '2008-01-20', $endTime = '11:00', $tzOffset = '-08')
{
$gdataCal = new Zend_Gdata_Calendar($client);
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($title);
$newEvent->where = array($gdataCal->newWhere($where));
$newEvent->content = $gdataCal->newContent("$desc");
$when = $gdataCal->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$newEvent->when = array($when);
// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
$createdEvent = $gdataCal->insertEvent($newEvent);
return $createdEvent->id->text;
}

我尝试通过$newEvent->guests、$newEvent->与会者、$newEvent->与会者添加它。有人知道路吗?如果你也能告诉我如何选择带有id的日历而不是主日历,这也会很有帮助。提前谢谢。

您可以使用以下代码进行设置:-

 $who = $gcal->newwho();
$who->setEmail('myEm...@myDomain.com');
$event->setWho(array($who));