2009年7月29日星期三

[fw-gdata] Correct way to retrieve events from non-default calendars?

Hi folks,

So $calendar->getLink()->getHref() returns a full url like:

http://www.google.com/calendar/feeds/1bofflqv7fipee5cip4qmdgp40%40group.calendar.google.com

Plugging that into newEventQuery, e.g.:

$query = $service->newEventQuery('http://www.google.com/calendar/feeds/1bofflqv7fipee5cip4qmdgp40%40group.calendar.google.com');

creates a problem, because newEventQuery wants to include /default after it. $query->setUser(''); of course does not work, as any null user is set to "default" automatically.

I can of course strip "http://www.google.com/calendar/feeds/" out from the output of getHref() and feed that to setUser() but that seems a bit silly.

Is that how it's done, or is there something I'm missing?

-Josh

没有评论: