2011-10-31 51 views
0

我正尝试使用Zend_Gdata_Calendar库在Google Calendar API上创建新事件,并且努力研究如何设置可见性 - 有没有人有任何想法实际上做到了吗?使用Zend Google Calendar API创建私人活动PHP框架

我的类的构造具有

$this->calendar_client = Zend_Gdata_ClientLogin::getHttpClient($this->user_name, $this->password, Zend_Gdata_Calendar::AUTH_SERVICE_NAME); 

凡user_name和pass_word是,它能够写入日历的帐户登录详细信息。以下作品

$gdataCal = new Zend_Gdata_Calendar($this->calendar_client); 

$newEvent = $gdataCal->newEventEntry(); 
$newEvent->title = $gdataCal->newTitle($title); 
$newEvent->where = array($gdataCal->newWhere($where)); 
$newEvent->content = $gdataCal->newContent($content); 
$newEvent->visibility = 'private'; 
$when = $gdataCal->newWhen(); 
$when->startTime = $start_time; 
$when->endTime  = $end_time; 
$newEvent->when = array($when); 
$createdEvent = $gdataCal->insertEvent($newEvent,"https://www.google.com/calendar/feeds/{$email}/private/full"); 

($标题,$哪里,$内容是文本字符串传递给函数)

但是知名度不缝习惯。

我已经试过以上,也显示每个以下的知名度,

$newEvent->setVisibility($gdataCal->newVisibility('private')); 
$newEvent->setVisibility($gdataCal->newVisibility(true)); 
$newEvent->setVisibility($gdataCal->newVisibility(false)); 

虽然所有这些工作(即在正确的时间创建一个事件)的私人标志,从来没有!

回答

0

回答我自己的问题,你需要使用它的URI!

$newEvent->visibility = $gdataCal->newVisibility("http://schemas.google.com/g/2005#event.public"); 

$newEvent->visibility = $gdataCal->newVisibility("http://schemas.google.com/g/2005#event.private");