Service/Flickr.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Flickr  
Version
$Id$  

\Zend_Service_Flickr

Package: Zend_Service\Flickr
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  URI_BASE = 'http://www.flickr.com'
Base URI for the REST client

Properties

>VPropertyprotected\Zend_Rest_Client $_restClient = null
Reference to REST client object
Default valuenullDetails
Type
\Zend_Rest_Client
>VPropertypublicstring $apiKey
Your Flickr API key
Details
Type
string

Methods

methodpublic__construct(string $apiKey) : void

Performs object initializations

# Sets up character encoding # Saves the API key
Parameters
NameTypeDescription
$apiKeystring

Your Flickr API key

methodprotected_checkErrors(\DOMDocument $dom) : void
static

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

Parameters
NameTypeDescription
$dom\DOMDocument
Throws
ExceptionDescription
\Zend_Service_Exception
methodprotected_compareOptions(array $options, array $validOptions) : void

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

Parameters
NameTypeDescription
$optionsarray

User options

$validOptionsarray

Valid options

Throws
ExceptionDescription
\Zend_Service_Exception
methodprotected_prepareOptions(string $method, array $options, array $defaultOptions) : array

Prepare options for the request

Parameters
NameTypeDescription
$methodstring

Flickr Method to call

$optionsarray

User Options

$defaultOptionsarray

Default Options

Returns
TypeDescription
arrayMerged array of user and default/required options
methodprotected_validateGroupPoolGetPhotos(array $options) : void

Validate Group Search Options

Parameters
NameTypeDescription
$optionsarray
Throws
ExceptionDescription
\Zend_Service_Exception
methodprotected_validateTagSearch(array $options) : void

Validate Tag Search Options

Parameters
NameTypeDescription
$optionsarray
Throws
ExceptionDescription
\Zend_Service_Exception
methodprotected_validateUserSearch(array $options) : void

Validate User Search Options

Parameters
NameTypeDescription
$optionsarray
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublicgetIdByEmail(string $email) : string

Utility function to find Flickr User IDs for emails.

(You can only find a user's photo with their NSID.)
Parameters
NameTypeDescription
$emailstring

the email

Returns
TypeDescription
stringthe NSID (userid)
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublicgetIdByUsername(string $username) : string

Utility function to find Flickr User IDs for usernames.

(You can only find a user's photo with their NSID.)
Parameters
NameTypeDescription
$usernamestring

the username

Returns
TypeDescription
stringthe NSID (userid)
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublicgetImageDetails(string $id) : array

Returns Flickr photo details by for the given photo ID

Parameters
NameTypeDescription
$idstring

the NSID

Returns
TypeDescription
arrayof Zend_Service_Flickr_Image, details for the specified image
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublicgetRestClient() : \Zend_Rest_Client

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

Returns
TypeDescription
\Zend_Rest_Client
methodpublicgroupPoolGetPhotos(string $query, array $options = array()) : \Zend_Service_Flickr_ResultSet

Finds photos in a group's pool.

Parameters
NameTypeDescription
$querystring

group id

$optionsarray

Additional parameters to refine your query.

Returns
TypeDescription
\Zend_Service_Flickr_ResultSet
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublictagSearch(string | array $query, array $options = array()) : \Zend_Service_Flickr_ResultSet

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
NameTypeDescription
$querystring | array

A single tag or an array of tags.

$optionsarray

Additional parameters to refine your query.

Returns
TypeDescription
\Zend_Service_Flickr_ResultSet
Throws
ExceptionDescription
\Zend_Service_Exception
methodpublicuserSearch(string $query, array $options = null) : \Zend_Service_Flickr_ResultSet

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
NameTypeDescription
$querystring

username or email

$optionsarray

Additional parameters to refine your query.

Returns
TypeDescription
\Zend_Service_Flickr_ResultSet
Throws
ExceptionDescription
\Zend_Service_Exception
Documentation was generated by phpDocumentor 2.2.0 .