views:

369

answers:

1

Hey everyone,

I know that you can use setVisibility('private-abcdefg') for newEventQuery() in order to specify a particular calendar.

My question is, can I use the same concept for newEventEntry()?

$gdataCal = new Zend_Gdata_Calendar($client);

 $newEvent = $gdataCal->newEventEntry();

 $newEvent->setVisibility('private-******************');

I tried out this code, but I receive the error:

 Fatal error: Call to a member function getDOM() on a non-object in /home/content/b/e/h/behrk2/html/ZendGdata-1.8.4PL1/library/Zend/Gdata/Kind/EventEntry.php on line 154

Is there anything I can do to accomplish this? Because I have multiple Google Calendar's in one account, and I would like to specify which Calendar an event should go to...

Thanks!

+1  A: 

You're overthinking it. I had the same exact problem, and it's simple, but not obvious, and took me some digging through the documentation to notice. To post to a calendar other than the default calendar, just add the uri to the other calendar to the insertEvent function at the end, like so:

$createdEvent = $gdataCal->insertEvent($newEvent, $uri);
Cin