本文整理汇总了PHP中Zend_Gdata::getEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata::getEntry方法的具体用法?PHP Zend_Gdata::getEntry怎么用?PHP Zend_Gdata::getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata
的用法示例。
在下文中一共展示了Zend_Gdata::getEntry方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetEntryExceptionInvalidLocationType
public function testGetEntryExceptionInvalidLocationType()
{
$gdata = new Zend_Gdata();
try {
// give it neither a string nor a Zend_Gdata_Query object,
// and see if it throws an exception.
$feed = $gdata->getEntry(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());
}
}
示例2: getVolumeEntry
public function getVolumeEntry($volumeId = null, $location = null)
{
if ($volumeId !== null) {
$uri = self::VOLUME_FEED_URI . "/" . $volumeId;
} else {
if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
}
return parent::getEntry($uri, 'Zend_Gdata_Books_VolumeEntry');
}
示例3: getDocumentListEntry
public function getDocumentListEntry($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_Docs_DocumentListEntry');
}
示例4: getCommentEntry
/**
* Retreive a single CommentEntry object.
*
* @param mixed $location The location for the feed, as a URL or Query.
* @return Zend_Gdata_Photos_CommentEntry
* @throws Zend_Gdata_App_Exception
* @throws Zend_Gdata_App_HttpException
*/
public function getCommentEntry($location)
{
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_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else {
if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
}
}
return parent::getEntry($uri, 'Zend_Gdata_Photos_CommentEntry');
}
示例5: getListEntry
/**
* Gets a list entry.
*
* @param string $location A ListQuery or a URI specifying the entry location.
* @return ListEntry
*/
public function getListEntry($location)
{
if ($location instanceof Zend_Gdata_Spreadsheets_ListQuery) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return parent::getEntry($uri, 'Zend_Gdata_Spreadsheets_ListEntry');
}
示例6: getHealthProfileEntry
/**
* Retrieve a profile entry object
*
* @param mixed $query The query for the feed, as a URL or Query
* @return Zend_Gdata_Health_ProfileEntry
*/
public function getHealthProfileEntry($query = null)
{
if ($query === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException('Query must not be null');
} else {
if ($query instanceof Zend_Gdata_Query) {
$uri = $query->getQueryUrl();
} else {
$uri = $query;
}
}
return parent::getEntry($uri, 'Zend_Gdata_Health_ProfileEntry');
}
示例7: getContactEntry
/**
* Retrieve a single feed object by id
*
* @param string $entryID
* @return string|Zend_Gdata_App_Feed
*/
public function getContactEntry($entryID)
{
return parent::getEntry($entryID, 'Zend_Gdata_Contacts_ListEntry');
}
示例8: testDisableAndReEnableXMLToObjectMappingReturnsObject
public function testDisableAndReEnableXMLToObjectMappingReturnsObject()
{
$gdata = new Zend_Gdata();
$gdata->useObjectMapping(false);
$xmlString = $gdata->getEntry('http://gdata.youtube.com/feeds/api/videos/O4SWAfisH-8');
$this->assertEquals('string', gettype($xmlString));
$gdata->useObjectMapping(true);
$entry = $gdata->getEntry('http://gdata.youtube.com/feeds/api/videos/O4SWAfisH-8');
$this->assertTrue($entry instanceof Zend_Gdata_Entry);
}
示例9: urlencode
message( 'Fetching all "My Contacts" from destination account...' );
$dest_query = new Zend_Gdata_Query( 'http://www.google.com/m8/feeds/contacts/default/full' );
$dest_query->maxResults = 99999;
$dest_query->setParam( 'group', 'http://www.google.com/m8/feeds/groups/' . urlencode($dest_user) . '/base/6' ); // "My Contacts" only
$dest_feed = $dest_gdata->getFeed( $dest_query );
message( $dest_feed->totalResults . ' contacts found.' );
// Clear out all existing contacts
if ( (string) $dest_feed->totalResults > 0 ) {
message( 'Clearing all "My Contacts" from destination account...' );
foreach ( $dest_feed as $entry ) {
if ( !$editlink = $entry->getEditLink() )
continue;
$entry = $dest_gdata->getEntry( $editlink->getHref() );
$dest_gdata->delete( $entry );
message( ' Deleted ' . $entry->title );
}
message( 'Existing "My Contacts" cleared from destination account.' );
}
// Fetch all source contacts
message( 'Fetching all "My Contacts" from source account...' );
$source_query = new Zend_Gdata_Query( 'http://www.google.com/m8/feeds/contacts/default/full' );
$source_query->maxResults = 99999;
$source_query->setParam( 'group', 'http://www.google.com/m8/feeds/groups/' . urlencode($source_user) . '/base/6' ); // "My Contacts" only
$source_feed = $source_gdata->getFeed( $source_query );
message( $source_feed->totalResults . ' contacts found.' );
示例10: getGbaseItemEntry
/**
* Retreive entry object
*
* @param mixed $location The location for the feed, as a URL or Query
* @return Zend_Gdata_Gbase_ItemEntry
*/
public function getGbaseItemEntry($location = null)
{
if ($location === null) {
require_once PHP_LIBRARY_PATH . '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_Gbase_ItemEntry');
}
示例11: retreiveSingleContact
/**
* retrieves single contact from Gmail associated with a User.
*
* @param string : contact self link
*/
function retreiveSingleContact($link_self)
{
global $_SESSION, $_GET;
$client = $this->client;
//This is to fetch single contact which is to be updated.
// Create a Gdata object using the authenticated Http Client
$gdata = new Zend_Gdata($client);
try {
$entry = $gdata->getEntry($link_self);
$data = $this->pushContactIntoArray($entry);
$contacts[] = $data;
return $contacts;
} catch (Exception $e) {
$status_code = $gdata->getHttpClient()->getLastResponse()->getStatus();
$this->status_code_desc = $this->getStatusDescription($status_code);
}
}