'http://schemas.google.com/gCal/2005'); /** * Create Gdata_Calendar object * * @param Zend_Http_Client $client (optional) The HTTP client to use when * when communicating with the Google servers. * @param string $applicationId The identity of the app in the form of Company-AppName-Version */ public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0') { $this->registerPackage('Zend_Gdata_Calendar'); $this->registerPackage('Zend_Gdata_Calendar_Extension'); parent::__construct($client, $applicationId); $this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME); } /** * Retreive feed object * * @param mixed $location The location for the feed, as a URL or Query * @return Zend_Gdata_Calendar_EventFeed */ public function getCalendarEventFeed($location = null) { if ($location == null) { $uri = self::CALENDAR_EVENT_FEED_URI; } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Calendar_EventFeed'); } /** * Retreive entry object * * @return Zend_Gdata_Calendar_EventEntry */ public function getCalendarEventEntry($location = null) { if ($location == null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'Location must not be null'); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getEntry($uri, 'Zend_Gdata_Calendar_EventEntry'); } /** * Retrieve feed object * * @return Zend_Gdata_Calendar_ListFeed */ public function getCalendarListFeed() { $uri = self::CALENDAR_FEED_URI . '/default'; return parent::getFeed($uri,'Zend_Gdata_Calendar_ListFeed'); } /** * Retreive entryobject * * @return Zend_Gdata_Calendar_ListEntry */ public function getCalendarListEntry($location = null) { if ($location == null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'Location must not be null'); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getEntry($uri,'Zend_Gdata_Calendar_ListEntry'); } public function insertEvent($event, $uri=null) { if ($uri == null) { $uri = $this->_defaultPostUri; } $newEvent = $this->insertEntry($event, $uri, 'Zend_Gdata_Calendar_EventEntry'); return $newEvent; } }