Php 在日历列表中插入新日历

Php 在日历列表中插入新日历,php,google-calendar-api,Php,Google Calendar Api,没用了,我没有错。我的新日历不会出现在我的日历列表中,即使所有内容似乎都已正确创建,有任何线索吗 public function insertCalendars($calendarSummary) { try { $calendar = new Google_Service_Calendar_Calendar(); $calendar->setSummary($calendarSummary); $createdCalendar =

没用了,我没有错。我的新日历不会出现在我的日历列表中,即使所有内容似乎都已正确创建,有任何线索吗

public function insertCalendars($calendarSummary) {
    try {
        $calendar = new Google_Service_Calendar_Calendar();
        $calendar->setSummary($calendarSummary);
        $createdCalendar = $this->_service->calendars->insert($calendar);

        $calendarListEntry = new Google_Service_Calendar_CalendarListEntry();
        $calendarListEntry->setId($createdCalendar->getId());    
        $createdCalendarListEntry = $this->_service->calendarList->insert($calendarListEntry);
        return json_encode($createdCalendarListEntry->getSummary()); 
    } catch(Exception $e) {
        // wtv catching, there's no error anyway
    }

}
有些事我不明白。我得到了我在日历列表中添加的日历,但它没有显示在谷歌日历可视化中。 我正在使用一个服务帐户,似乎这是一个拥有日历的服务帐户,这是我没有得到的


因此,我从管理员帐户和服务帐户共享了一些日历,并且它可以正常工作。我想要的是从服务帐户插入我可以在管理员帐户中看到的新日历,知道如何做吗?我在服务帐户日历列表中创建的日历在哪里=D

您正在吞咽异常-您确定它没有进入catch块然后消失吗。可能有助于记录或吐出任何异常。我简化了代码,但我保证不会捕获任何异常。您正在吞咽异常-您确定它没有进入捕获块然后消失吗。可能有助于记录或抛出任何异常。我已经简化了代码,但我保证不会捕获任何异常