[PHP] Cannot call $calendarList->getItems() when retrieving list of calendars

130 views
Skip to first unread message

CS

unread,
Dec 1, 2011, 7:09:41 PM12/1/11
to google-ca...@googlegroups.com
Hey there,

I'm currently in the process of retrieving a list of the user's calendars. Going off the PHP examples in the developer's guide, I can call

$calendarList = $service->calendarList->listCalendarList();

just fine, but when I enter the while loop and call

foreach ($calendarList->getItems() as $calendarListEntry) {

my code throws a "Call to a member function getItems() on a non-object" error. I've noticed that $calendarList is of type Array, and I can call print_r on it just fine (and it appears to return the correct results). Does anyone know what's going on?

Also, along those lines, is there some sort of library documentation for PHP for v3.0? I'd like to know the methods needed to, say, get the calendar ID's, but I can't find this information anywhere.

Thanks!


CS

unread,
Dec 1, 2011, 7:20:20 PM12/1/11
to google-ca...@googlegroups.com
SWEETNESS! Okay, for all y'all dudes and dudettes who are facing the same issues as me, I just started referring to everything by array syntax and it all started working beautifully (example: $calendarList['items']) and I'm going by that giant chart at the bottom of the documentation webpage to get the variables and such I need.

I totally don't know if this is the right way to go around doing this because that's not what the documentation says, but heyyy I'm not dogmatic. It works. :]
Reply all
Reply to author
Forward
0 new messages