Google Calendar API V3如何将与会者添加到现有与会者列表中? [英] Google Calendar API V3 how do I add an attendee to a list of existing attendees?
问题描述
我已经有一个$ event->参与者,并且已有一些参与者. 我想向此事件添加新的EventAttendee,但看来我的代码粉碎了旧的与会者列表.
I already have an $event->attendees with some existing attendees. I would like to add new EventAttendee to this event but it looks like my code crushes the old attendees list.
我尝试
$attendeesx= $event->getAttendees();
$attendees = array_push($attendeesx,$newattendee);
$event->attendees = $attendees;
$service->events->update(MyCalendar, $event->getID(), $event);
不起作用.无论如何,我想添加,而不是用新列表替换旧列表. 有任何线索吗?
not working. Anyway I would like to add, not replace the old list by a new one. Any clue?
什么是额外的客人?它是干什么的?
What is additionalGuest? What is it made for?
推荐答案
array_push($attendeesx,$newattendee)
修改$attendeesx
到位.比意味着实际上不应该将返回值(int
)分配给$attendees
.
array_push($attendeesx,$newattendee)
modifies the $attendeesx
in place. Than means the return value (which is an int
) really should not be assigned to $attendees
.
活动还为参与者提供了一个塞特尔,为什么不使用它呢? ;)
Also event has a setter for attendees, why not use that? ;)
这篇关于Google Calendar API V3如何将与会者添加到现有与会者列表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!