私はしばらくこれと戦ってきましたが、ようやく機能するようになりました。これはうまくラップされていませんが、これが私が探していた答えです
まず、カレンダー ID を取得する必要があります。カレンダーを開いて名前の横にある下矢印アイコンをクリックすると、カレンダー設定のオプションが表示されます。そのメニュー項目を選択します。下部近くにカレンダーのアドレスが表示されます。カレンダー ID を見つけるのに少し時間がかかります。次のようになります。
(カレンダー ID: o4g3921hdiaq5p8kdat2l4vgis@group.calendar.google.com)
o4g39j1hdihq4p8kdat2l4vgis@group.calendar.google.com が必要です
将来的には、これをphpで取得したいと考えていますが、今のところハードコーディングできます。だから私はこれに変数を設定します
$calendar_user = 'o4g39j1hdihq4p8kdat2l4vgis@group.calendar.google.com';
イベントを取得するときは、このように setUser します
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser($calendar_user);
ただし、イベントを追加するときは、イベントを挿入する時点で $calendar_user を使用する必要があります。
ここに完全なコードがあります
$calendar_user = 'o4g39j1hdihq4p8kdat2l4vgis@group.calendar.google.com';
$user = 'myemail@yahoo.com';
$pass = 'mygooglecalendarpassword';
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
$gc = new Zend_Gdata_Calendar($client);
$newEntry = $gc->newEventEntry();
$newEntry->title = $gc->newTitle("mytitle");
$newEntry->where = array($gc->newWhere("meeting place"));
$newEntry->content = $gc->newContent("Meeting description");
$newEntry->content->type = 'text';
$when = $gc->newWhen();
$when->startTime = "{'2012-06-28'}T{'10:00'}:00.000{'-08'}:00";
$when->endTime = "{'2012-06-28'}T{'11:00'}:00.000{'-08'}:00";
$newEntry->when = array($when);
$createdEvent = $gc->insertEvent($newEntry, "http://www.google.com/calendar/feeds/".$calendar_user."/private/full");
今、それがお役に立てば幸いです。これを理解するのに時間がかかりすぎたと言いますが、私は世界で最も賢い人ではありません.