API Documentation

Service/Flickr.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Flickr
version
$Id: Flickr.php 22599 2010-07-16 21:25:22Z mikaelkael $
Classes
Zend_Service_Flickr

Description

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.

Zend_Service_Flickr

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Flickr
Constants
URI_BASE
Properties
$apiKey
$_restClient
Methods
__construct
tagSearch
userSearch
groupPoolGetPhotos
getIdByUsername
getIdByEmail
getImageDetails
getRestClient
_validateUserSearch
_validateTagSearch
_validateGroupPoolGetPhotos
_checkErrors
_prepareOptions
_compareOptions

Description

Constants

URI_BASE

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

Base URI for the REST client

Details

value
http://www.flickr.com

Properties

$_restClient

Zend_Rest_Client $_restClient = 'null'

Reference to REST client object

Details

$_restClient
Zend_Rest_Client
visibility
protected
default
null
final
false
static
false

$apiKey

string $apiKey = ''

Your Flickr API key

Details

$apiKey
string
visibility
public
default
final
false
static
false

Methods

__construct

__construct( string $apiKey ) : void

Performs object initializations

Sets up character encoding

# Saves the API key

Arguments
$apiKey
string
Your Flickr API key
Details
visibility
public
final
false
static
false

_checkErrors

_checkErrors( DOMDocument $dom ) : void

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

Arguments
$dom
DOMDocument
Details
visibility
protected
final
false
static
true
throws

_compareOptions

_compareOptions( array $options, array $validOptions ) : void

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

Arguments
$options
array
User options
$validOptions
array
Valid options
Details
visibility
protected
final
false
static
false
throws

_prepareOptions

_prepareOptions( string $method, array $options, array $defaultOptions ) : array

Prepare options for the request

Arguments
$method
string
Flickr Method to call
$options
array
User Options
$defaultOptions
array
Default Options
Output
array
Merged array of user and default/required options
Details
visibility
protected
final
false
static
false

_validateGroupPoolGetPhotos

_validateGroupPoolGetPhotos( array $options ) : void

Validate Group Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateTagSearch

_validateTagSearch( array $options ) : void

Validate Tag Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateUserSearch

_validateUserSearch( array $options ) : void

Validate User Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

getIdByEmail

getIdByEmail( string $email ) : string

Utility function to find Flickr User IDs for emails.

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

Arguments
$email
string
the email
Output
string
the NSID (userid)
Details
visibility
public
final
false
static
false
throws

getIdByUsername

getIdByUsername( string $username ) : string

Utility function to find Flickr User IDs for usernames.

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

Arguments
$username
string
the username
Output
string
the NSID (userid)
Details
visibility
public
final
false
static
false
throws

getImageDetails

getImageDetails( string $id ) : array

Returns Flickr photo details by for the given photo ID

Arguments
$id
string
the NSID
Output
array
of Zend_Service_Flickr_Image, details for the specified image
Details
visibility
public
final
false
static
false
throws

getRestClient

getRestClient( ) : Zend_Rest_Client

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

Details
visibility
public
final
false
static
false

groupPoolGetPhotos

groupPoolGetPhotos( string $query, array $options = array ) : Zend_Service_Flickr_ResultSet

Finds photos in a group's pool.

Arguments
$query
string
group id
$options
array
Additional parameters to refine your query.
Details
visibility
public
final
false
static
false
throws

tagSearch

tagSearch( 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.

Arguments
$query
stringarray
A single tag or an array of tags.
$options
array
Additional parameters to refine your query.
Details
visibility
public
final
false
static
false
throws

userSearch

userSearch( 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.

Arguments
$query
string
username or email
$options
array
Additional parameters to refine your query.
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.