Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_Flickr Class Reference

Public Member Functions

 __construct ($apiKey)
 tagSearch ($query, array $options=array())
 userSearch ($query, array $options=null)
 groupPoolGetPhotos ($query, array $options=array())
 getIdByUsername ($username)
 getIdByEmail ($email)
 getImageDetails ($id)
 getRestClient ()

Data Fields

const URI_BASE = 'http://www.flickr.com'
 $apiKey

Protected Member Functions

 _validateUserSearch (array $options)
 _validateTagSearch (array $options)
 _validateGroupPoolGetPhotos (array $options)
 _prepareOptions ($method, array $options, array $defaultOptions)
 _compareOptions (array $options, array $validOptions)

Static Protected Member Functions

static _checkErrors (DOMDocument $dom)

Protected Attributes

 $_restClient = null

Detailed Description

Definition at line 32 of file Flickr.php.


Constructor & Destructor Documentation

__construct ( apiKey)

Performs object initializations

# Sets up character encoding # Saves the API key

Parameters:
string$apiKeyYour Flickr API key
Returns:
void

Definition at line 63 of file Flickr.php.


Member Function Documentation

static _checkErrors ( DOMDocument $  dom) [static, protected]

Throws an exception if and only if the response status indicates a failure

Parameters:
DOMDocument$dom
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception

Definition at line 577 of file Flickr.php.

Here is the caller graph for this function:

_compareOptions ( array options,
array validOptions 
) [protected]

Throws an exception if and only if any user options are invalid

Parameters:
array$optionsUser options
array$validOptionsValid options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception

Definition at line 617 of file Flickr.php.

Here is the caller graph for this function:

_prepareOptions ( method,
array options,
array defaultOptions 
) [protected]

Prepare options for the request

Parameters:
string$methodFlickr Method to call
array$optionsUser Options
array$defaultOptionsDefault Options
Returns:
array Merged array of user and default/required options

Definition at line 600 of file Flickr.php.

Here is the caller graph for this function:

_validateGroupPoolGetPhotos ( array options) [protected]

Validate Group Search Options

Parameters:
array$options
Exceptions:
Zend_Service_Exception
Returns:
void
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Validate_Int
Zend_Service_Exception
Todo:
The following does not do anything [yet], so it is commented out.

Definition at line 523 of file Flickr.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateTagSearch ( array options) [protected]

Validate Tag Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Validate_Int
Zend_Service_Exception
Todo:
The following does not do anything [yet], so it is commented out.

Definition at line 464 of file Flickr.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateUserSearch ( array options) [protected]

Validate User Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Validate_Int
Zend_Service_Exception
Todo:
The following does not do anything [yet], so it is commented out.

Definition at line 410 of file Flickr.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getIdByEmail ( email)

Utility function to find Flickr User IDs for emails.

(You can only find a user's photo with their NSID.)

Parameters:
string$emailthe email
Returns:
string the NSID (userid)
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Exception

Definition at line 306 of file Flickr.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getIdByUsername ( username)

Utility function to find Flickr User IDs for usernames.

(You can only find a user's photo with their NSID.)

Parameters:
string$usernamethe username
Returns:
string the NSID (userid)
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Exception

Definition at line 262 of file Flickr.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getImageDetails ( id)

Returns Flickr photo details by for the given photo ID

Parameters:
string$idthe NSID
Returns:
array of Zend_Service_Flickr_Image, details for the specified image
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Flickr_Image

Definition at line 348 of file Flickr.php.

Here is the call graph for this function:

Returns a reference to the REST client, instantiating it if necessary

Returns:
Zend_Rest_Client
See also:
Zend_Rest_Client

Definition at line 389 of file Flickr.php.

Here is the caller graph for this function:

groupPoolGetPhotos ( query,
array options = array() 
)

Finds photos in a group's pool.

Parameters:
string$querygroup id
array$optionsAdditional parameters to refine your query.
Returns:
Zend_Service_Flickr_ResultSet
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Flickr_ResultSet

Definition at line 204 of file Flickr.php.

Here is the call graph for this function:

tagSearch ( query,
array options = array() 
)

Find Flickr photos by tag.

Query options include:

# per_page: how many results to return per query # page: the starting page offset. first result will be (page - 1) * per_page + 1 # tag_mode: Either 'any' for an OR combination of tags, or 'all' for an AND combination. Default is 'any'. # min_upload_date: Minimum upload date to search on. Date should be a unix timestamp. # max_upload_date: Maximum upload date to search on. Date should be a unix timestamp. # min_taken_date: Minimum upload date to search on. Date should be a MySQL datetime. # max_taken_date: Maximum upload date to search on. Date should be a MySQL datetime.

Parameters:
string | array$queryA single tag or an array of tags.
array$optionsAdditional parameters to refine your query.
Returns:
Zend_Service_Flickr_ResultSet
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Flickr_ResultSet

Definition at line 92 of file Flickr.php.

Here is the call graph for this function:

userSearch ( query,
array options = null 
)

Finds photos by a user's username or email.

Additional query options include:

# per_page: how many results to return per query # page: the starting page offset. first result will be (page - 1) * per_page + 1 # min_upload_date: Minimum upload date to search on. Date should be a unix timestamp. # max_upload_date: Maximum upload date to search on. Date should be a unix timestamp. # min_taken_date: Minimum upload date to search on. Date should be a MySQL datetime. # max_taken_date: Maximum upload date to search on. Date should be a MySQL datetime.

Parameters:
string$queryusername or email
array$optionsAdditional parameters to refine your query.
Returns:
Zend_Service_Flickr_ResultSet
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Flickr_ResultSet

Definition at line 150 of file Flickr.php.

Here is the call graph for this function:


Field Documentation

$_restClient = null [protected]

Definition at line 51 of file Flickr.php.

$apiKey

Definition at line 44 of file Flickr.php.

const URI_BASE = 'http://www.flickr.com'

Base URI for the REST client

Definition at line 37 of file Flickr.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations