예제 #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');
 }
예제 #2
0
파일: GDataTest.php 프로젝트: stunti/zf2
 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());
     }
 }
예제 #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');
 }
예제 #4
0
파일: Gapps.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }
예제 #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');
 }
예제 #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));
 }
예제 #7
0
파일: Books.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }
예제 #8
0
파일: Photos.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }
예제 #9
0
파일: Health.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }
예제 #10
0
파일: Docs.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }
예제 #11
0
파일: Gbase.php 프로젝트: alab1001101/zf2
 /**
  * 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');
 }