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; } }