Esempio n. 1
0
 /**
  * Retrieve data feed object
  *
  * @param mixed $location
  * @return Analytics\DataFeed
  */
 public function getDataFeed($location = self::ANALYTICS_FEED_URI)
 {
     if ($location instanceof Query) {
         $uri = $location->getQueryUrl();
     } else {
         $uri = $location;
     }
     return parent::getFeed($uri, 'Zend\\GData\\Analytics\\DataFeed');
 }
Esempio n. 2
0
 public function testGetFeedExceptionInvalidLocationType()
 {
     $gdata = new GData\GData();
     try {
         // give it neither a string nor a Zend_GData_Query object,
         // and see if it throws an exception.
         $feed = $gdata->getFeed(new \stdClass());
         $this->fail('Expecting to catch Zend\\GData\\App\\InvalidArgumentException');
     } catch (\Zend\Exception $e) {
         $this->assertType('Zend\\GData\\App\\InvalidArgumentException', $e, 'Expecting Zend\\GData\\App\\InvalidArgumentException, got ' . get_class($e));
         $this->assertEquals('You must specify the location as either a string URI or a child of Zend\\GData\\Query', $e->getMessage());
     }
 }
Esempio n. 3
0
 /**
  * Gets a list feed.
  *
  * @param mixed $location A ListQuery, WorksheetEntry or string URI specifying the feed location.
  * @return ListFeed
  */
 public function getListFeed($location)
 {
     if ($location instanceof ListQuery) {
         $uri = $location->getQueryUrl();
     } else {
         if ($location instanceof WorksheetEntry) {
             $uri = $location->getLink(self::LIST_FEED_LINK_URI)->href;
         } else {
             $uri = $location;
         }
     }
     return parent::getFeed($uri, '\\Zend\\GData\\Spreadsheets\\ListFeed');
 }
Esempio n. 4
0
 /**
  * Retreive EmailListRecipientFeed object containing multiple
  * EmailListRecipientEntry objects.
  *
  * @param mixed $location The location for the feed, as a URL or Query.
  * @return \Zend\GData\GApps\EmailListRecipientFeed
  * @throws \Zend\GData\App\Exception
  * @throws \Zend\GData\App\HttpException
  * @throws \Zend\GData\GApps\ServiceException
  */
 public function getEmailListRecipientFeed($location)
 {
     if ($location === null) {
         throw new App\InvalidArgumentException('Location must not be null');
     } else {
         if ($location instanceof GData\Query) {
             $uri = $location->getQueryUrl();
         } else {
             $uri = $location;
         }
     }
     return parent::getFeed($uri, '\\Zend\\GData\\GApps\\EmailListRecipientFeed');
 }
Esempio n. 5
0
 /**
  * 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');
 }
Esempio n. 6
0
 public function testDisableXMLToObjectMappingReturnsStringForEntry()
 {
     $gdata = new GData\GData();
     $gdata::useObjectMapping(false);
     $xmlString = $gdata->getFeed('http://gdata.youtube.com/feeds/api/videos/O4SWAfisH-8');
     $this->assertEquals('string', gettype($xmlString));
 }
Esempio n. 7
0
 /**
  * Retrieves a feed of volumes, by default the User annotation feed
  *
  * @param \Zend\GData\Query|string|null $location (optional) The URL to
  *        query.
  * @return \Zend\GData\Books\VolumeFeed The feed of volumes found at the
  *         specified URL.
  */
 public function getUserAnnotationFeed($location = null)
 {
     if ($location == null) {
         $uri = self::MY_ANNOTATION_FEED_URI;
     } else {
         $uri = $location;
     }
     return parent::getFeed($uri, '\\Zend\\GData\\Books\\VolumeFeed');
 }
Esempio n. 8
0
 /**
  * Retreive PhotoFeed object containing comments and tags associated
  * with a given photo.
  *
  * @param mixed $location (optional) The location for the feed, as a URL
  *          or Query. If not specified, the community search feed will
  *          be returned instead.
  * @return \Zend\GData\Photos\PhotoFeed
  * @throws \Zend\GData\App\Exception
  * @throws \Zend\GData\App\HttpException
  */
 public function getPhotoFeed($location = null)
 {
     if ($location === null) {
         $uri = self::PICASA_BASE_FEED_URI . '/' . self::DEFAULT_PROJECTION . '/' . self::COMMUNITY_SEARCH_PATH;
     } else {
         if ($location instanceof UserQuery) {
             $location->setType('feed');
             $uri = $location->getQueryUrl();
         } else {
             if ($location instanceof GData\Query) {
                 $uri = $location->getQueryUrl();
             } else {
                 $uri = $location;
             }
         }
     }
     return parent::getFeed($uri, '\\Zend\\GData\\Photos\\PhotoFeed');
 }
Esempio n. 9
0
 /**
  * Retrieve a user's profile as a feed object.  If ClientLogin is used, the
  * profile associated with $this->_profileID is returned, otherwise
  * the profile associated with the AuthSub token is read.
  *
  * @param mixed $query The query for the feed, as a URL or Query
  * @return \Zend\GData\Health\ProfileFeed
  */
 public function getHealthProfileFeed($query = null)
 {
     if ($this->_httpClient->getClientLoginToken() !== null && $this->getProfileID() == null) {
         throw new App\AuthException('Profile ID must not be null. Did you call setProfileID()?');
     }
     if ($query instanceof GData\Query) {
         $uri = $query->getQueryUrl();
     } else {
         if ($this->_httpClient->getClientLoginToken() !== null && $query == null) {
             $uri = self::CLIENTLOGIN_PROFILE_FEED_URI . '/' . $this->getProfileID();
         } else {
             if ($query === null) {
                 $uri = self::AUTHSUB_PROFILE_FEED_URI;
             } else {
                 $uri = $query;
             }
         }
     }
     // use correct feed for /h9 or /health
     if ($this->_useH9Sandbox) {
         $uri = preg_replace('/\\/health\\//', '/h9/', $uri);
     }
     return parent::getFeed($uri, '\\Zend\\GData\\Health\\ProfileFeed');
 }
Esempio n. 10
0
 /**
  * Retreive feed object containing entries for the user's documents.
  *
  * @param mixed $location The location for the feed, as a URL or Query
  * @return \Zend\GData\Docs\DocumentListFeed
  */
 public function getDocumentListFeed($location = null)
 {
     if ($location === null) {
         $uri = self::DOCUMENTS_LIST_FEED_URI;
     } else {
         if ($location instanceof GData\Query) {
             $uri = $location->getQueryUrl();
         } else {
             $uri = $location;
         }
     }
     return parent::getFeed($uri, '\\Zend\\GData\\Docs\\DocumentListFeed');
 }
Esempio n. 11
0
 /**
  * Retrieve feed object
  *
  * @param mixed $location The location for the feed, as a URL or Query
  * @return \Zend\GData\GBase\SnippetFeed
  */
 public function getGBaseSnippetFeed($location = null)
 {
     if ($location === null) {
         $uri = self::GBASE_SNIPPET_FEED_URI;
     } else {
         if ($location instanceof GData\Query) {
             $uri = $location->getQueryUrl();
         } else {
             $uri = $location;
         }
     }
     return parent::getFeed($uri, '\\Zend\\GData\\GBase\\SnippetFeed');
 }