【问题标题】:Google Calendar API V3 how do I add an attendee to a list of existing attendees?Google Calendar API V3 如何将与会者添加到现有与会者列表中?
【发布时间】:2014-09-25 22:35:13
【问题描述】:

我已经有一个 $event->attendees 和一些现有的与会者。 我想在此活动中添加新的 EventAttendee,但看起来我的代码破坏了旧的与会者列表。

我试试

$attendeesx= $event->getAttendees();
$attendees = array_push($attendeesx,$newattendee);
$event->attendees = $attendees;
$service->events->update(MyCalendar, $event->getID(), $event);

不工作。无论如何,我想添加,而不是用新列表替换旧列表。 有什么线索吗?

什么是additionalGuest?它是做什么用的?

【问题讨论】:

    标签: google-calendar-api google-api-php-client


    【解决方案1】:

    array_push($attendeesx,$newattendee) 修改了$attendeesx。比意味着返回值(即int)确实不应该分配给$attendees

    还有一个活动参与者的设置器,为什么不使用它呢? ;)

    【讨论】:

    • setter 正在删除现有的与会者,以放置新的与会者。我正在寻找的是一个 addattendee 和 removeattendee ,其中所有现有的与会者及其特征都得到保护,新的与会者或一些现有的与会者被删除。如果您知道这样做的方法...谢谢
    • array_push($attendeesx,$newattendee) 是正确的。只是不要在任何地方分配结果,因为 $attendeesx 已经包含你想要的。
    猜你喜欢
    • 1970-01-01
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多