Gdata/YouTube.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Gdata
- Subpackage
- YouTube
- Version
- $Id: YouTube.php 24796 2012-05-12 03:34:26Z adamlundrigan $
\Zend_Gdata_YouTube
Service class for interacting with the YouTube Data API.
As the Google data API protocol is based upon the Atom Publishing Protocol (APP), Gdata functionality extends the appropriate Zend_Gdata_App classes
- Parent(s)
- \Zend_Gdata_Media < \Zend_Gdata < \Zend_Gdata_App
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Link
- http://code.google.com/apis/youtube/
Constants

string
AUTH_SERVICE_NAME
= 'youtube'
Service name for use with Google's authentication mechanisms
- string

STANDARD_RECENTLY_FEATURED_URI
= 'https://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'

STANDARD_RECENTLY_FEATURED_URI_V2
= 'https://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'

STANDARD_WATCH_ON_MOBILE_URI_V2
= 'https://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'

string
IN_REPLY_TO_SCHEME
= 'http://gdata.youtube.com/schemas/2007#in-reply-to'
The URI of the in-reply-to schema for comments in reply to other comments.
- string

string
INBOX_FEED_URI
= 'https://gdata.youtube.com/feeds/api/users/default/inbox'
The URI of the inbox feed for the currently authenticated user.
- string

integer
ACTIVITY_FEED_MAX_USERS
= 20
The maximum number of users for which activity can be requested for, as enforced by the API.
- integer

DEFAULT_MAJOR_PROTOCOL_VERSION
= 1
Default major protocol version.
Inherited from: \Zend_Gdata_App::DEFAULT_MAJOR_PROTOCOL_VERSION\Zend_Gdata::DEFAULT_MAJOR_PROTOCOL_VERSION\Zend_Gdata_Media::DEFAULT_MAJOR_PROTOCOL_VERSION- Inherited_from
- \Zend_Gdata_App::DEFAULT_MAJOR_PROTOCOL_VERSION
- Inherited_from
- \Zend_Gdata::DEFAULT_MAJOR_PROTOCOL_VERSION
- Inherited_from
- \Zend_Gdata_Media::DEFAULT_MAJOR_PROTOCOL_VERSION
- See
- \global\_majorProtocolVersion

DEFAULT_MINOR_PROTOCOL_VERSION
= null
Default minor protocol version.
Inherited from: \Zend_Gdata_App::DEFAULT_MINOR_PROTOCOL_VERSION\Zend_Gdata::DEFAULT_MINOR_PROTOCOL_VERSION\Zend_Gdata_Media::DEFAULT_MINOR_PROTOCOL_VERSION- Inherited_from
- \Zend_Gdata_App::DEFAULT_MINOR_PROTOCOL_VERSION
- Inherited_from
- \Zend_Gdata::DEFAULT_MINOR_PROTOCOL_VERSION
- Inherited_from
- \Zend_Gdata_Media::DEFAULT_MINOR_PROTOCOL_VERSION
- See
- \global\_minorProtocolVersion
Properties


string $_defaultPostUri = null
Default URI to which to POST.
Inherited from: \Zend_Gdata::$$_defaultPostUri\Zend_Gdata_Media::$$_defaultPostUrinull
Details- Type
- string
- Inherited_from
- \Zend_Gdata::$$_defaultPostUri
- Inherited_from
- \Zend_Gdata_Media::$$_defaultPostUri


boolean $_gzipEnabled = false
Enable gzipped responses?
Inherited from: \Zend_Gdata_App::$$_gzipEnabled\Zend_Gdata::$$_gzipEnabled\Zend_Gdata_Media::$$_gzipEnabledfalse
Details- Type
- boolean
- Inherited_from
- \Zend_Gdata_App::$$_gzipEnabled
- Inherited_from
- \Zend_Gdata::$$_gzipEnabled
- Inherited_from
- \Zend_Gdata_Media::$$_gzipEnabled


\Zend_Gdata_HttpClient $_httpClient =
Client object used to communicate
Inherited from: \Zend_Gdata::$$_httpClient\Zend_Gdata_Media::$$_httpClient- Type
- \Zend_Gdata_HttpClient
- Inherited_from
- \Zend_Gdata::$$_httpClient
- Inherited_from
- \Zend_Gdata_Media::$$_httpClient


boolean $_httpMethodOverride = false
Override HTTP PUT and DELETE request methods?
Inherited from: \Zend_Gdata_App::$$_httpMethodOverride\Zend_Gdata::$$_httpMethodOverride\Zend_Gdata_Media::$$_httpMethodOverridefalse
Details- Type
- boolean
- Inherited_from
- \Zend_Gdata_App::$$_httpMethodOverride
- Inherited_from
- \Zend_Gdata::$$_httpMethodOverride
- Inherited_from
- \Zend_Gdata_Media::$$_httpMethodOverride


$_majorProtocolVersion =
Indicates the major protocol version that should be used.
Inherited from: \Zend_Gdata_App::$$_majorProtocolVersion\Zend_Gdata::$$_majorProtocolVersion\Zend_Gdata_Media::$$_majorProtocolVersionAt present, recognized values are either 1 or 2. However, any integer value >= 1 is considered valid.
Under most circumtances, this will be automatically set by Zend_Gdata_App subclasses.
- Type
- n/a
- Inherited_from
- \Zend_Gdata_App::$$_majorProtocolVersion
- Inherited_from
- \Zend_Gdata::$$_majorProtocolVersion
- Inherited_from
- \Zend_Gdata_Media::$$_majorProtocolVersion
- See
- \global\setMajorProtocolVersion()
- See
- \global\getMajorProtocolVersion()


int $_maxRedirects = 5
Maximum number of redirects to follow during HTTP operations
Inherited from: \Zend_Gdata_App::$$_maxRedirects\Zend_Gdata::$$_maxRedirects\Zend_Gdata_Media::$$_maxRedirects5
Details- Type
- int
- Inherited_from
- \Zend_Gdata_App::$$_maxRedirects
- Inherited_from
- \Zend_Gdata::$$_maxRedirects
- Inherited_from
- \Zend_Gdata_Media::$$_maxRedirects


$_minorProtocolVersion =
Indicates the minor protocol version that should be used.
Inherited from: \Zend_Gdata_App::$$_minorProtocolVersion\Zend_Gdata::$$_minorProtocolVersion\Zend_Gdata_Media::$$_minorProtocolVersionCan be set to either an integer >= 0, or NULL if no minor version should be sent to the server.
At present, this field is not used by any Google services, but may be used in the future.
Under most circumtances, this will be automatically set by Zend_Gdata_App subclasses.
- Type
- n/a
- Inherited_from
- \Zend_Gdata_App::$$_minorProtocolVersion
- Inherited_from
- \Zend_Gdata::$$_minorProtocolVersion
- Inherited_from
- \Zend_Gdata_Media::$$_minorProtocolVersion
- See
- \global\setMinorProtocolVersion()
- See
- \global\getMinorProtocolVersion()


array $_registeredPackages = array('Zend_Gdata_Kind', 'Zend_Gdata_Extension', 'Zend_Gdata', 'Zend_Gdata_App_Extension', 'Zend_Gdata_App')
Packages to search for classes when using magic __call method, in order.
Inherited from: \Zend_Gdata::$$_registeredPackages\Zend_Gdata_Media::$$_registeredPackagesarray('Zend_Gdata_Kind', 'Zend_Gdata_Extension', 'Zend_Gdata', 'Zend_Gdata_App_Extension', 'Zend_Gdata_App')
Details- Type
- array
- Inherited_from
- \Zend_Gdata::$$_registeredPackages
- Inherited_from
- \Zend_Gdata_Media::$$_registeredPackages


\Zend_Gdata_HttpClient $_staticHttpClient = null
Client object used to communicate in static context
Inherited from: \Zend_Gdata::$$_staticHttpClient\Zend_Gdata_Media::$$_staticHttpClientnull
Details- Type
- \Zend_Gdata_HttpClient
- Inherited_from
- \Zend_Gdata::$$_staticHttpClient
- Inherited_from
- \Zend_Gdata_Media::$$_staticHttpClient


boolean $_useObjectMapping = true
Whether we want to use XML to object mapping when fetching data.
Inherited from: \Zend_Gdata_App::$$_useObjectMapping\Zend_Gdata::$$_useObjectMapping\Zend_Gdata_Media::$$_useObjectMappingtrue
Details- Type
- boolean
- Inherited_from
- \Zend_Gdata_App::$$_useObjectMapping
- Inherited_from
- \Zend_Gdata::$$_useObjectMapping
- Inherited_from
- \Zend_Gdata_Media::$$_useObjectMapping


boolean $_verboseExceptionMessages = true
Use verbose exception messages.
Inherited from: \Zend_Gdata_App::$$_verboseExceptionMessages\Zend_Gdata::$$_verboseExceptionMessages\Zend_Gdata_Media::$$_verboseExceptionMessagesIn the case of HTTP errors, use the body of the HTTP response in the exception message.
true
Details- Type
- boolean
- Inherited_from
- \Zend_Gdata_App::$$_verboseExceptionMessages
- Inherited_from
- \Zend_Gdata::$$_verboseExceptionMessages
- Inherited_from
- \Zend_Gdata_Media::$$_verboseExceptionMessages


array $namespaces = array(array('yt', 'http://gdata.youtube.com/schemas/2007', 1, 0), array('georss', 'http://www.georss.org/georss', 1, 0), array('gml', 'http://www.opengis.net/gml', 1, 0), array('media', 'http://search.yahoo.com/mrss/', 1, 0))
Namespaces used for Zend_Gdata_YouTube
array(array('yt', 'http://gdata.youtube.com/schemas/2007', 1, 0), array('georss', 'http://www.georss.org/georss', 1, 0), array('gml', 'http://www.opengis.net/gml', 1, 0), array('media', 'http://search.yahoo.com/mrss/', 1, 0))
Details- Type
- array
Methods


__call(string $method, array $args) : void
Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions.
Inherited from: \Zend_Gdata_App::__call()\Zend_Gdata::__call()\Zend_Gdata_Media::__call()For instance, to construct a new Zend_Gdata_Calendar_Extension_Color, a developer simply needs to do $gCal->newColor(). For this magic constructor, packages are searched in the same order as which they appear in the $_registeredPackages array
Name | Type | Description |
---|---|---|
$method | string | The method name being called |
$args | array | The arguments passed to the call |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


__construct(\Zend_Http_Client $client = null, string $applicationId = 'MyCompany-MyApp-1.0', string $clientId = null, string $developerKey = null) : void
Create Zend_Gdata_YouTube object
Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | (optional) The HTTP client to use when when communicating with the Google servers. |
$applicationId | string | The identity of the app in the form of Company-AppName-Version |
$clientId | string | The clientId issued by the YouTube dashboard |
$developerKey | string | The developerKey issued by the YouTube dashboard |


delete(mixed $data, $remainingRedirects = null) : void
DELETE entry with client object
Inherited from: \Zend_Gdata_App::delete()\Zend_Gdata::delete()\Zend_Gdata_Media::delete()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or URL to delete |
$remainingRedirects |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |


enableRequestDebugLogging(string $logfile) : void
This method enables logging of requests by changing the Zend_Http_Client_Adapter used for performing the requests.
Inherited from: \Zend_Gdata_App::enableRequestDebugLogging()\Zend_Gdata::enableRequestDebugLogging()\Zend_Gdata_Media::enableRequestDebugLogging()NOTE: This will not work if you have customized the adapter already to use a proxy server or other interface.
Name | Type | Description |
---|---|---|
$logfile | string | The logfile to use when logging the requests |


generateIfMatchHeaderData( $data, $allowWeek) : string | null
Returns the data for an If-Match header based on the current Etag property.
Inherited from: \Zend_Gdata_App::generateIfMatchHeaderData()\Zend_Gdata::generateIfMatchHeaderData()\Zend_Gdata_Media::generateIfMatchHeaderData()If Etags are not supported by the server or cannot be extracted from the data, then null will be returned.
Name | Type | Description |
---|---|---|
$data | ||
$allowWeek |
Type | Description |
---|---|
string | null | $data |


get(string $uri, array $extraHeaders = array()) : \Zend_Http_Response
GET a URI using client object.
Inherited from: \Zend_Gdata_App::get()\Zend_Gdata::get()\Zend_Gdata_Media::get()Name | Type | Description |
---|---|---|
$uri | string | GET URI |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |


getActivityForUser( $username) : \Zend_Gdata_YouTube_ActivityFeed
Retrieves the activity feed for users
Name | Type | Description |
---|---|---|
$username |
Type | Description |
---|---|
\Zend_Gdata_YouTube_ActivityFeed |
Exception | Description |
---|---|
\Zend_Gdata_App_VersionException | if using version less than 2. |


getContactFeed(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_ContactFeed
Retrieves a feed of a user's contacts
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_ContactFeed | The feed of contacts |


getEntry(mixed $location, $className = 'Zend_Gdata_Entry') : string | \Zend_Gdata_App_Entry
Retrieve entry as string or object
Inherited from: \Zend_Gdata::getEntry()\Zend_Gdata_Media::getEntry()Name | Type | Description |
---|---|---|
$location | mixed | The location as string or Zend_Gdata_Query |
$className |
Type | Description |
---|---|
string | \Zend_Gdata_App_Entry | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |


getFeed(mixed $location, string $className = 'Zend_Gdata_Feed') : string | \Zend_Gdata_App_Feed
Retrieve feed as string or object
Inherited from: \Zend_Gdata::getFeed()\Zend_Gdata_Media::getFeed()Name | Type | Description |
---|---|---|
$location | mixed | The location as string or Zend_Gdata_Query |
$className | string | The class type to use for returning the feed |
Type | Description |
---|---|
string | \Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |


getFormUploadToken(\Zend_Gdata_YouTube_VideoEntry $videoEntry, string $url = 'https://gdata.youtube.com/action/GetUploadToken') : array
Retrieves a YouTube token
Name | Type | Description |
---|---|---|
$videoEntry | \Zend_Gdata_YouTube_VideoEntry | The video entry |
$url | string | The location as a string URL |
Type | Description |
---|---|
array | An array containing a token and URL |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


getFriendActivityForCurrentUser() : \Zend_Gdata_YouTube_ActivityFeed
Retrieve the activity of the currently authenticated users friend.
Type | Description |
---|---|
\Zend_Gdata_YouTube_ActivityFeed |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | if not logged in. |


getFullVideoEntry( $videoId) : \Zend_Gdata_YouTube_VideoEntry | null
Retrieves a video entry from the user's upload feed.
Name | Type | Description |
---|---|---|
$videoId |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoEntry | null | The video entry to be retrieved, or null if it was not found or the user requesting it did not have the appropriate permissions. |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |


getGzipEnabled() : boolean
Get the HTTP override state
Inherited from: \Zend_Gdata_App::getGzipEnabled()\Zend_Gdata::getGzipEnabled()\Zend_Gdata_Media::getGzipEnabled()Type | Description |
---|---|
boolean |


getHttpClient() : \Zend_Http_Client
Get the Zend_Http_Client object used for communication
Inherited from: \Zend_Gdata_App::getHttpClient()\Zend_Gdata::getHttpClient()\Zend_Gdata_Media::getHttpClient()Type | Description |
---|---|
\Zend_Http_Client |


getHttpMethodOverride() : boolean
Get the HTTP override state
Inherited from: \Zend_Gdata_App::getHttpMethodOverride()\Zend_Gdata::getHttpMethodOverride()\Zend_Gdata_Media::getHttpMethodOverride()Type | Description |
---|---|
boolean |


getInboxFeedForCurrentUser() : \Zend_Gdata_YouTube_InboxFeed | null
Retrieve a feed of messages in the currently authenticated user's inbox.
Type | Description |
---|---|
\Zend_Gdata_YouTube_InboxFeed | null |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | if not logged in. |


getMajorProtocolVersion() : int
Get the major protocol version that is in use.
Inherited from: \Zend_Gdata_App::getMajorProtocolVersion()\Zend_Gdata::getMajorProtocolVersion()\Zend_Gdata_Media::getMajorProtocolVersion()Type | Description |
---|---|
int | The major protocol version in use. |
- See
- \global\_majorProtocolVersion


getMaxRedirects() : int
Get the maximum number of redirects to follow during HTTP operations
Inherited from: \Zend_Gdata_App::getMaxRedirects()\Zend_Gdata::getMaxRedirects()\Zend_Gdata_Media::getMaxRedirects()Type | Description |
---|---|
int | Maximum number of redirects to follow |


getMinorProtocolVersion() : \(int | \NULL)
Get the minor protocol version that is in use.
Inherited from: \Zend_Gdata_App::getMinorProtocolVersion()\Zend_Gdata::getMinorProtocolVersion()\Zend_Gdata_Media::getMinorProtocolVersion()Type | Description |
---|---|
\(int | \NULL) | The major protocol version in use, or NULL if no minor version is specified. |
- See
- \global\_minorProtocolVersion


getMostViewedVideoFeed(mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of the most viewed videos.
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


getNextFeed(\Zend_Gdata_App_Feed $feed, string $className = null) : \Zend_Gdata_App_Feed | null
Retrieve next set of results based on a given feed.
Inherited from: \Zend_Gdata_App::getNextFeed()\Zend_Gdata::getNextFeed()\Zend_Gdata_Media::getNextFeed()Name | Type | Description |
---|---|---|
$feed | \Zend_Gdata_App_Feed | The feed from which to retreive the next set of results. |
$className | string | (optional) The class of feed to be returned. If null, the next feed (if found) will be the same class as the feed that was given as the first argument. |
Type | Description |
---|---|
\Zend_Gdata_App_Feed | null | Returns a Zend_Gdata_App_Feed or null if no next set of results exists. |


getPlaylistListFeed(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_PlaylistListFeed
Retrieves a feed which lists a user's playlist
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_PlaylistListFeed | The feed of playlists |


getPlaylistVideoFeed(mixed $location) : \Zend_Gdata_YouTube_PlaylistVideoFeed
Retrieves a feed of videos in a particular playlist
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_PlaylistVideoFeed | The feed of videos found at the specified URL. |


getPreviousFeed(\Zend_Gdata_App_Feed $feed, string $className = null) : \Zend_Gdata_App_Feed | null
Retrieve previous set of results based on a given feed.
Inherited from: \Zend_Gdata_App::getPreviousFeed()\Zend_Gdata::getPreviousFeed()\Zend_Gdata_Media::getPreviousFeed()Name | Type | Description |
---|---|---|
$feed | \Zend_Gdata_App_Feed | The feed from which to retreive the previous set of results. |
$className | string | (optional) The class of feed to be returned. If null, the previous feed (if found) will be the same class as the feed that was given as the first argument. |
Type | Description |
---|---|
\Zend_Gdata_App_Feed | null | Returns a Zend_Gdata_App_Feed or null if no previous set of results exists. |


getRecentlyFeaturedVideoFeed(mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of recently featured videos.
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


getRelatedVideoFeed(string $videoId = null, mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of videos related to the specified video ID.
Name | Type | Description |
---|---|---|
$videoId | string | The videoId of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


getStaticHttpClient() : \Zend_Http_Client
Gets the HTTP client object.
Inherited from: \Zend_Gdata_App::getStaticHttpClient()\Zend_Gdata::getStaticHttpClient()\Zend_Gdata_Media::getStaticHttpClient()If none is set, a new Zend_Http_Client will be used.
Type | Description |
---|---|
\Zend_Http_Client |


getSubscriptionFeed(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_SubscriptionListFeed
Retrieves a feed of a user's subscriptions
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_SubscriptionListFeed | The feed of subscriptions |


getTopRatedVideoFeed(mixed $location = null) : \Zend_Gdata_YouTube_CommentFeed
Retrieves a feed of comments related to the specified video ID.
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_CommentFeed | The feed of videos found at the specified URL. |


getUserFavorites(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a user's favorites
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The videos favorited by the user |


getUserProfile(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_UserProfileEntry
Retrieves a user's profile as an entry
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_UserProfileEntry | The user profile entry |


getUserUploads(string $user = null, mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a user's uploads
Name | Type | Description |
---|---|---|
$user | string | (optional) The username of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The videos uploaded by the user |


getVerboseExceptionMessages() : boolean
Get whether to use verbose exception messages
Inherited from: \Zend_Gdata_App::getVerboseExceptionMessages()\Zend_Gdata::getVerboseExceptionMessages()\Zend_Gdata_Media::getVerboseExceptionMessages()In the case of HTTP errors, use the body of the HTTP response in the exception message.
Type | Description |
---|---|
boolean |


getVideoCommentFeed(string $videoId = null, mixed $location = null) : \Zend_Gdata_YouTube_CommentFeed
Retrieves a feed of comments related to the specified video ID.
Name | Type | Description |
---|---|---|
$videoId | string | The videoId of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_CommentFeed | The feed of videos found at the specified URL. |


getVideoEntry(mixed $videoId = null, mixed $location = null, boolean $fullEntry = false) : \Zend_Gdata_YouTube_VideoEntry
Retrieves a specific video entry.
Name | Type | Description |
---|---|---|
$videoId | mixed | The ID of the video to retrieve. |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined. |
$fullEntry | boolean | (optional) Retrieve the full metadata for the entry. Only possible if entry belongs to currently authenticated user. An exception will be thrown otherwise. |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoEntry | The video entry found at the specified URL. |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |


getVideoFeed(mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of videos.
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


getVideoResponseFeed(string $videoId = null, mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of video responses related to the specified video ID.
Name | Type | Description |
---|---|---|
$videoId | string | The videoId of interest |
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


getWatchOnMobileVideoFeed(mixed $location = null) : \Zend_Gdata_YouTube_VideoFeed
Retrieves a feed of videos recently featured for mobile devices.
These videos will have RTSP links in the $entry->mediaGroup->content
Name | Type | Description |
---|---|---|
$location | mixed | (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined |
Type | Description |
---|---|
\Zend_Gdata_YouTube_VideoFeed | The feed of videos found at the specified URL. |


import(string $uri, \Zend_Http_Client $client = null, string $className = 'Zend_Gdata_Feed') : string | \Zend_Gdata_App_Feed
Imports a feed located at $uri.
Inherited from: \Zend_Gdata::import()\Zend_Gdata_Media::import()Name | Type | Description |
---|---|---|
$uri | string | |
$client | \Zend_Http_Client | The client used for communication |
$className | string | The class which is used as the return type |
Type | Description |
---|---|
string | \Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


importFile(string $filename, string $className = 'Zend_Gdata_App_Feed', string $useIncludePath = false) : \Zend_Gdata_App_Feed
Imports a feed from a file located at $filename.
Inherited from: \Zend_Gdata_App::importFile()\Zend_Gdata::importFile()\Zend_Gdata_Media::importFile()Name | Type | Description |
---|---|---|
$filename | string | |
$className | string | The class which is used as the return type |
$useIncludePath | string | Whether the include_path should be searched |
Type | Description |
---|---|
\Zend_Gdata_App_Feed |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


importString(string $string, string $className = 'Zend_Gdata_App_Feed', $majorProtocolVersion = null, $minorProtocolVersion = null) : \Zend_Gdata_App_Feed
Imports a feed represented by $string.
Inherited from: \Zend_Gdata_App::importString()\Zend_Gdata::importString()\Zend_Gdata_Media::importString()Name | Type | Description |
---|---|---|
$string | string | |
$className | string | The class which is used as the return type |
$majorProtocolVersion | ||
$minorProtocolVersion |
Type | Description |
---|---|
\Zend_Gdata_App_Feed |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


importUrl(string $url, string $className = 'Zend_Gdata_App_Feed', array $extraHeaders = array()) : string | \Zend_Gdata_App_Feed
Imports the specified URL (non-statically).
Inherited from: \Zend_Gdata_App::importUrl()\Zend_Gdata::importUrl()\Zend_Gdata_Media::importUrl()Name | Type | Description |
---|---|---|
$url | string | The URL to import |
$className | string | The class which is used as the return type |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
string | \Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


insertEntry(mixed $data, string $uri, string $className = 'Zend_Gdata_App_Entry', array $extraHeaders = array()) : \Zend_Gdata_App_Entry
Inserts an entry to a given URI and returns the response as a fully formed Entry.
Inherited from: \Zend_Gdata_App::insertEntry()\Zend_Gdata::insertEntry()\Zend_Gdata_Media::insertEntry()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | POST URI |
$className | string | The class of entry to be returned. |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Gdata_App_Entry | The entry returned by the service after insertion. |


isAuthenticated() : boolean
Determines whether service object is authenticated.
Inherited from: \Zend_Gdata::isAuthenticated()\Zend_Gdata_Media::isAuthenticated()Type | Description |
---|---|
boolean | True if service object is authenticated, false otherwise. |


parseFormUploadTokenResponse(string $response) : array
Helper function for parsing a YouTube token response
Name | Type | Description |
---|---|---|
$response | string | The service response |
Type | Description |
---|---|
array | An array containing the token and URL |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


performHttpRequest(string $method, string $url, array $headers = array(), string $body = null, string $contentType = null, int $remainingRedirects = null) : \Zend_Http_Response
Performs a HTTP request using the specified method.
Inherited from: \Zend_Gdata::performHttpRequest()\Zend_Gdata_Media::performHttpRequest()Overrides the definition in the parent (Zend_Gdata_App) and uses the Zend_Gdata_HttpClient functionality to filter the HTTP requests and responses.
Name | Type | Description |
---|---|---|
$method | string | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
$url | string | The URL to which this request is being performed, or null if found in $data |
$headers | array | An associative array of HTTP headers for this request |
$body | string | The body of the HTTP request |
$contentType | string | The value for the content type of the request body |
$remainingRedirects | int | Number of redirects to follow if requests results in one |
Type | Description |
---|---|
\Zend_Http_Response | The response object |


post(mixed $data, string $uri = null, $remainingRedirects = null, string $contentType = null, array $extraHeaders = null) : \Zend_Http_Response
POST data with client object
Inherited from: \Zend_Gdata_App::post()\Zend_Gdata::post()\Zend_Gdata_Media::post()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | POST URI |
$remainingRedirects | ||
$contentType | string | Content-type of the data |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |


prepareRequest(string $method, string $url = null, array $headers = array(), mixed $data = null, string $contentTypeOverride = null) : array
Provides pre-processing for HTTP requests to APP services.
Inherited from: \Zend_Gdata_App::prepareRequest()\Zend_Gdata::prepareRequest()\Zend_Gdata_Media::prepareRequest()- Checks the $data element and, if it's an entry, extracts the XML, multipart data, edit link (PUT,DELETE), etc.
- If $data is a string, sets the default content-type header as 'application/atom+xml' if it's not already been set.
- Adds a x-http-method override header and changes the HTTP method to 'POST' if necessary as per getHttpMethodOverride()
Name | Type | Description |
---|---|---|
$method | string | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
$url | string | The URL to which this request is being performed, or null if found in $data |
$headers | array | An associative array of HTTP headers for this request |
$data | mixed | The Zend_Gdata_App_Entry or XML for the body of the request |
$contentTypeOverride | string | The override value for the content type of the request body |
Type | Description |
---|---|
array | An associative array containing the determined 'method', 'url', 'data', 'headers', 'contentType' |


put(mixed $data, string $uri = null, $remainingRedirects = null, string $contentType = null, array $extraHeaders = null) : \Zend_Http_Response
PUT data with client object
Inherited from: \Zend_Gdata_App::put()\Zend_Gdata::put()\Zend_Gdata_Media::put()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | PUT URI |
$remainingRedirects | ||
$contentType | string | Content-type of the data |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |


registerPackage(string $name) : void
Adds a Zend Framework package to the $_registeredPackages array.
Inherited from: \Zend_Gdata_App::registerPackage()\Zend_Gdata::registerPackage()\Zend_Gdata_Media::registerPackage()This array is searched when using the magic __call method below to instantiante new objects.
Name | Type | Description |
---|---|---|
$name | string | The name of the package (eg Zend_Gdata_App) |


replyToCommentEntry(\Zend_Gdata_YouTube_CommentEntry $commentEntry, string $commentText) : \Zend_Gdata_YouTube_CommentEntry
Post a comment in reply to an existing comment
Name | Type | Description |
---|---|---|
$commentEntry | \Zend_Gdata_YouTube_CommentEntry | The comment entry to reply to |
$commentText | string | The text of the comment to post |
Type | Description |
---|---|
\Zend_Gdata_YouTube_CommentEntry | the posted comment |


retrieveAllEntriesForFeed(object $feed) : mixed
Retrieve all entries for a feed, iterating through pages as necessary.
Inherited from: \Zend_Gdata_App::retrieveAllEntriesForFeed()\Zend_Gdata::retrieveAllEntriesForFeed()\Zend_Gdata_Media::retrieveAllEntriesForFeed()Be aware that calling this function on a large dataset will take a significant amount of time to complete. In some cases this may cause execution to timeout without proper precautions in place.
Name | Type | Description |
---|---|---|
$feed | object | The feed to iterate through. |
Type | Description |
---|---|
mixed | A new feed of the same type as the one originally passed in, containing all relevent entries. |


sendVideoMessage(string $body, \Zend_Gdata_YouTube_VideoEntry $videoEntry = null, string $videoId = null, string $recipientUserName) : \Zend_Gdata_YouTube_InboxEntry | null
Send a video message.
Note: Either a Zend_Gdata_YouTube_VideoEntry or a valid video ID must be provided.
Name | Type | Description |
---|---|---|
$body | string | The body of the message |
$videoEntry | \Zend_Gdata_YouTube_VideoEntry | (optional) The video entry to send |
$videoId | string | The id of the video to send |
$recipientUserName | string | The username of the recipient |
Type | Description |
---|---|
\Zend_Gdata_YouTube_InboxEntry | null | The Zend_Gdata_YouTube_Inbox_Entry representing the sent message. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException | if no valid Zend_Gdata_YouTube_VideoEntry or videoId were provided |


setGzipEnabled(boolean $enabled = false) : void
Toggle requesting gzip encoded responses
Inherited from: \Zend_Gdata_App::setGzipEnabled()\Zend_Gdata::setGzipEnabled()\Zend_Gdata_Media::setGzipEnabled()Name | Type | Description |
---|---|---|
$enabled | boolean | Whether or not to enable gzipped responses |


setHttpClient(\Zend_Http_Client $client, $applicationId = 'MyCompany-MyApp-1.0', $clientId = null, $developerKey = null) : \Zend_Gdata_App
Set the Zend_Http_Client object used for communication
Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | The client to use for communication |
$applicationId | ||
$clientId | ||
$developerKey |
Type | Description |
---|---|
\Zend_Gdata_App | Provides a fluent interface |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |


setHttpMethodOverride(boolean $override = true) : void
Toggle using POST instead of PUT and DELETE HTTP methods
Inherited from: \Zend_Gdata_App::setHttpMethodOverride()\Zend_Gdata::setHttpMethodOverride()\Zend_Gdata_Media::setHttpMethodOverride()Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.
Name | Type | Description |
---|---|---|
$override | boolean | Whether to override PUT and DELETE with POST. |


setMajorProtocolVersion(int $value) : void
Set the major protocol version that should be used.
Inherited from: \Zend_Gdata_App::setMajorProtocolVersion()\Zend_Gdata::setMajorProtocolVersion()\Zend_Gdata_Media::setMajorProtocolVersion()Values < 1 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
Name | Type | Description |
---|---|---|
$value | int | The major protocol version to use. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |
- See
- \global\_majorProtocolVersion


setMaxRedirects(int $maxRedirects) : void
Set the maximum number of redirects to follow during HTTP operations
Inherited from: \Zend_Gdata_App::setMaxRedirects()\Zend_Gdata::setMaxRedirects()\Zend_Gdata_Media::setMaxRedirects()Name | Type | Description |
---|---|---|
$maxRedirects | int | Maximum number of redirects to follow |


setMinorProtocolVersion(\(int | \NULL) $value) : void
Set the minor protocol version that should be used.
Inherited from: \Zend_Gdata_App::setMinorProtocolVersion()\Zend_Gdata::setMinorProtocolVersion()\Zend_Gdata_Media::setMinorProtocolVersion()If set to NULL, no minor protocol version will be sent to the server. Values < 0 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
Name | Type | Description |
---|---|---|
$value | \(int | \NULL) | The minor protocol version to use. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |
- See
- \global\_minorProtocolVersion


setStaticHttpClient(\Zend_Http_Client $httpClient) : void
Set the static HTTP client instance
Inherited from: \Zend_Gdata_App::setStaticHttpClient()\Zend_Gdata::setStaticHttpClient()\Zend_Gdata_Media::setStaticHttpClient()Sets the static HTTP client object to use for retrieving the feed.
Name | Type | Description |
---|---|---|
$httpClient | \Zend_Http_Client |


setVerboseExceptionMessages(boolean $verbose) : void
Set whether to use verbose exception messages
Inherited from: \Zend_Gdata_App::setVerboseExceptionMessages()\Zend_Gdata::setVerboseExceptionMessages()\Zend_Gdata_Media::setVerboseExceptionMessages()In the case of HTTP errors, use the body of the HTTP response in the exception message.
Name | Type | Description |
---|---|---|
$verbose | boolean | Whether to use verbose exception messages |


updateEntry(mixed $data, string | null $uri = null, string | null $className = null, array $extraHeaders = array()) : \Zend_Gdata_App_Entry
Update an entry
Inherited from: \Zend_Gdata_App::updateEntry()\Zend_Gdata::updateEntry()\Zend_Gdata_Media::updateEntry()Name | Type | Description |
---|---|---|
$data | mixed | Zend_Gdata_App_Entry or XML (w/ID and link rel='edit') |
$uri | string | null | The URI to send requests to, or null if $data contains the URI. |
$className | string | null | The name of the class that should be deserialized from the server response. If null, then 'Zend_Gdata_App_Entry' will be used. |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Gdata_App_Entry | The entry returned from the server |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |


useObjectMapping(boolean $value) : void
Enable/disable the use of XML to object mapping.
Inherited from: \Zend_Gdata_App::useObjectMapping()\Zend_Gdata::useObjectMapping()\Zend_Gdata_Media::useObjectMapping()Name | Type | Description |
---|---|---|
$value | boolean | Pass in true to use the XML to object mapping. Pass in false or null to disable it. |


usingObjectMapping() : boolean
Determine whether service object is using XML to object mapping.
Inherited from: \Zend_Gdata_App::usingObjectMapping()\Zend_Gdata::usingObjectMapping()\Zend_Gdata_Media::usingObjectMapping()Type | Description |
---|---|
boolean | True if service object is using XML to object mapping, false otherwise. |