I started my project 1 year ago and never had to post in forums, 1 week ago i started developing with google calendar api and this is my 3rd post :s
I already create sucessfully single and recurring events, reminders for single events but now i need to know how to create reminders for recurring events with the Zend Gdata api.
This is the code i use to create reminders for single events:
function setReminder($client, $eventId, $minutes=15, $methods)
{
$gc = new Zend_Gdata_Calendar($client);
$reminder_types = array();
if ($event = getEvent($client, $eventId)) {
$times = $event->when;
var_dump($event);
foreach ($times as $when)
{
if(in_array('alert',$methods))
{
var_dump('alert');
$reminder_alert = $gc->newReminder();
$reminder_alert->setMinutes($minutes);
$reminder_alert->setMethod("alert");
array_push($reminder_types,$reminder_alert);
}
if(in_array('email',$methods))
{
var_dump('email');
$reminder_email = $gc->newReminder();
$reminder_email->setMinutes($minutes);
$reminder_email->setMethod("email");
array_push($reminder_types,$reminder_email);
}
$when->reminders = $reminder_types;
}
$eventNew = $event->save();
//var_dump($eventNew);
return $eventNew;
} else {
return null;
}
}
The problem is, for recurring events $event->when is empty.
Thanks in advance!