GData日历获取特定事件

发布于 2024-12-13 09:13:43 字数 160 浏览 3 评论 0原文

是否可以从特定日历中获取特定事件?

我从日历中收集所有事件,在设备上保存一些事件,然后需要检测源日历中该事件的任何更改。所以我需要某种方法通过 id 从 google 日历获取事件数据。 etag什么的。

有什么办法可以做到不再次收集完整的事件集吗?

多谢!

Is it possible to get specific event from specific calendar?

I collect all events from calendar, save some events on device and then need to detect any changes of this events in source calendar. So I need some way to get events data from google calendar by its id. etag or something.

Is there any way to do so not collecting full events set again?

Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

网名女生简单气质 2024-12-20 09:13:44

这是我使用的:

    # Gets the event with id $eventId from the calendar $calendar
function get_event_by_id_ex( $gdataCal, $eventId, $calendar='default' ){
if( !isset($eventId) )
{
    throw new Exception( INCORRECT_EVENT_ID );
}

try
{
    $query = $gdataCal->newEventQuery();
    $query->setUser($calendar);
    $query->setVisibility('private');
    $query->setProjection('full');
    $query->setEvent($eventId);

    $ctz = 'Europe/Lisbon';
    $query->setParam('ctz', $ctz);      

    $eventEntry = $gdataCal->getCalendarEventEntry($query);
}
catch (Zend_Gdata_App_Exception $e)
{   //var_dump($e); //DBUG
    throw new Exception( ERROR_ACCESSING_APPOINTMENT . ' (' .$eventId. ')' );
}

return $eventEntry;
}

Here's what I use:

    # Gets the event with id $eventId from the calendar $calendar
function get_event_by_id_ex( $gdataCal, $eventId, $calendar='default' ){
if( !isset($eventId) )
{
    throw new Exception( INCORRECT_EVENT_ID );
}

try
{
    $query = $gdataCal->newEventQuery();
    $query->setUser($calendar);
    $query->setVisibility('private');
    $query->setProjection('full');
    $query->setEvent($eventId);

    $ctz = 'Europe/Lisbon';
    $query->setParam('ctz', $ctz);      

    $eventEntry = $gdataCal->getCalendarEventEntry($query);
}
catch (Zend_Gdata_App_Exception $e)
{   //var_dump($e); //DBUG
    throw new Exception( ERROR_ACCESSING_APPOINTMENT . ' (' .$eventId. ')' );
}

return $eventEntry;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文