Hi all
I had followed the reference guide closely to successfully quick add a event entry into my google calendar applications. But now when I am trying to retrieve the entry for modifications, exception starts to kick in.
my codes go as below
PHP Code:
if($this->_hasParam('modifyEvent'))
{
//Retrieve information from database
Zend_Loader::loadClass('Zend_Auth_Adapter_DbTable');
$db = Zend_Registry::get('dbAdapter');
//Modify my own existing event
//Include libraries and application mode
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Http_Client');
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
//Retrieve login info for gmail.
$gserver = Zend_Registry::get('smtp_config');
$user = $gserver->smtp->username;
$pass = $gserver->smtp->password;
try
{
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
}
catch(Exception $e)
{
//TODO:Generate Error that having trouble logging into google
}
//Create an instance of the Calendar service
$service = new Zend_Gdata_Calendar($client);
//Create a new entry using the calendar service's magic factory method
try
{
//$CalendarList = $service->getCalendarListFeed();
//print("CalendarList<br><pre>");
//print_r($CalendarList);
//print("</pre>");
//$CalendarListE = $service->getCalendarListEntry();
// print("CalendarListE<br><pre>");
// print_r($CalendarListE);
// print("</pre>");
$CalendarEvent = $service->getCalendarEventFeed();
// print("CalendarEvent<br><pre>");
// print_r($CalendarEvent);
// print("</pre>");
foreach($CalendarEvent as $list)
{
/*
print($list->title . "<br><pre>");
print_r($list);
print("</pre>");
*/
echo "<ul>";
echo "<li>" . $list->title . "</li>";
echo "<li>" . $list->id . "</li>";
$event = $service->getCalendarEventEntry($list->id);
//print_r($event);
echo "</ul>";
}
//$CalendarEventE = $service->getCalendarEventEntry();
// print("CalendarEventE<br><pre>");
// print_r($CalendarEventE);
// print("</pre>");
}
catch(Exception $e)
{
print("<pre>");
print_r($e);
print("</pre>");
//Service not active to initialize a event object.
}
//$this->sessionData->UserObj->modifyEvent();
}
the problem is not with this line : $CalendarEvent = $service->getCalendarEventFeed();
but
it's with this line : $event = $service->getCalendarEventEntry($list->id);
Exception Message is : You must specify the location as either a string URI or a child of Zend_Gdata_Query