Services_YouTube
[ class tree: Services_YouTube ] [ index: Services_YouTube ] [ all elements ]

Class: Services_YouTube

Source Location: /Services_YouTube-0.2.0/YouTube.php

Class Overview


Services_YouTube


Author(s):

Version:

  • 0.2.0

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 37]
Services_YouTube


[ Top ]


Class Variables

$cacheOptions = array()

[line 93]

cache_lite options
  • Access: protected

Type:   array


[ Top ]

$developerId =  null

[line 71]

Developer ID
  • Access: protected

Type:   string


[ Top ]

$driver =  'rest'

[line 79]

driver
  • Access: protected

Type:   string


[ Top ]

$responseFormat =  'object'

[line 100]

format of the xml response
  • Access: protected

Type:   string


[ Top ]

$useCache =  false

[line 86]

Use cache
  • Access: protected

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 110]

void __construct( string $developerId, [ $options = array()])

Constructor
  • Access: public

Parameters:

string   $developerId   —  Developer ID
   $options   — 

[ Top ]

forArray   [line 412]

array forArray( mixed $object)

Parse all SimpleXMLElement to array
  • Access: protected

Parameters:

mixed   $object   —  SimpleXMLElement or array

[ Top ]

getDetails   [line 226]

array getDetails( string $videoId)

Displays the details for a video.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $videoId   —  The ID of the video to get details for. This is the ID that's returned by the list

[ Top ]

getProfile   [line 182]

array getProfile( string $user)

Retrieves the public parts of a user profile.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user   —  The user to retrieve the profile for. This is the same as the name that shows up on the YouTube website.

[ Top ]

listByTag   [line 243]

array listByTag( string $tag, [string $page = 1], [string $perPage = 20])

Lists all videos that have the specified tag.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $tag   —  the tag to search for
string   $page   —  the "page" of results you want to retrieve (e.g. 1, 2, 3) (default 1)
string   $perPage   —  the number of results you want to retrieve per page (default 20, maximum 100)

[ Top ]

listByUser   [line 263]

array listByUser( string $user)

Lists all videos that were uploaded by the specified user
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user   —  user whose videos you want to list

[ Top ]

listFavoriteVideos   [line 196]

array listFavoriteVideos( string $user)

Lists a user's favorite videos.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user   —  The user to retrieve the favorite videos for. This is the same as the name that shows up on the YouTube website

[ Top ]

listFeatured   [line 277]

array listFeatured( )

Lists the most recent 25 videos that have been featured on the front page of the YouTube site.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

[ Top ]

listFriends   [line 210]

array listFriends( string $user)

Lists a user's friends.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user   —  The user to retrieve the favorite videos for. This is the same as the name that shows up on the YouTube website

[ Top ]

parseResponse   [line 394]

SimpleXMLElement parseResponse( string $response)

parseResponse
  • Return: or array of the response data.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $response   — 

[ Top ]

sendRequest   [line 295]

SimpleXMLObject sendRequest( string $method, array $parameters)

Send Request either rest or xmlrpc approach, and return simplexml_element of the response.

When $this->usesCaches is true, use Cache_Lite the response xml. If $this->responseFormat is "array", return array, instead simplexml_element.

  • Return: or Array on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $method   — 
array   $parameters   — 

[ Top ]

setDriver   [line 130]

void setDriver( string $driver)

Choose which driver to use(XML-RPC or REST)
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $driver   — 

[ Top ]

setResponseFormat   [line 147]

void setResponseFormat( string $responseFormat)

Choose which Response Fomat to use(object or array)
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $responseFormat   — 

[ Top ]

setUseCache   [line 165]

void setUseCache( [mixed $useCache = false], [array $cacheOptions = array()])

Choose if this uses Cache_Lite.

If this uses Cache_Lite, then set the cacheOptions for Cache_Lite

  • Access: public

Parameters:

mixed   $useCache   — 
array   $cacheOptions   — 

[ Top ]

useRest   [line 338]

string useRest( string $method, array $parameters)

Use REST approach.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $method   — 
array   $parameters   — 

[ Top ]

useXMLRPC   [line 371]

string useXMLRPC( string $method, array $parameters)

Use XML-RPC approach.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $method   — 
array   $parameters   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:47:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.