On Fri, Dec 12, 2008 at 10:38 PM, Nick <[email protected]> wrote:
>
> Hello, I'm wondering how to instruct the
> Zend_Gdata_Calendar_EventQuery class to query external calendars, with
> the options I specify.
> For example, here is my code for displaying my current calendar:
>
> $query = $gdataCal->newEventQuery();
> $query->setUser(urlencode("[email protected]"));
> $query->setVisibility('private');
> $query->setProjection('full');
> $query->setOrderby('starttime');
> $query->setStartMin($startDate);
> $query->setStartMax($endDate);
> $query->setFutureevents(true);
> $eventFeed = $gdataCal->getCalendarEventFeed($query);
>
> This is fine, but how could I make that also query all my external
> calendars, such as US Holidays or a friend's shared calendar?
>
> I can itterate through them with getCalendarListFeed() but I do not
> know how to tell the EventQuery to use that, while still being able to
> set parameters such as startmin/max.
>
> Any advice?

Call getAlternateLink()->getHref() on a list entry to get the
calendar's feed URL.

Take that, and input it into your query:

    $query->url = $listEntry->getAlternateLink()->getHref()

(There's no setter documented for url, but that should still work
because of the library's "magic" setter's/getter's. This is filed as a
bug here: http://framework.zend.com/issues/browse/ZF-5270)

Finally, set any other options that you might want to use. You can
only set options that append query parameters. If you call setUser(),
for example, you'll get a malformed URL since that modifies the base
url itself.

-- 
Trevor Johns

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to