PHP Class Horde_Service_Facebook_Photos, horde

Copyright 2009-2016 Horde LLC (http://www.horde.org/)
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Horde_Service_Facebook_Base
Datei anzeigen Open project: horde/horde

Public Methods

Method Description
addTag ( string $pid, array $options = [] ) : boolean Adds a tag with the given information to a photo. See the wiki for details:
createAlbum ( string $name, string $description = '', string $uid = 'me' ) : array Creates and returns a new album owned by the specified user or the current session user.
get ( array $filter = [], array $options = [] ) : array Returns photos according to the filters specified.
getAlbums ( integer $uid = 'me', string $aids = null ) : array Returns the albums created by the given user.
getTags ( string $pid ) : array Return the tags for a photo.
upload ( array $params = [] ) : array Uploads a photo.

Method Details

addTag() public method

http://wiki.developers.facebook.com/index.php/Photos.addTag
public addTag ( string $pid, array $options = [] ) : boolean
$pid string The ID of the photo to be tagged
$options array An options array: - to: (string) A UID of the user being tagged. - text: (string) Text to name the user if UID is not known/available. - x: (float) The horizontal position of the tag as a percentage from the left of the photo. - y: (float) The vertical position of the tag as a percentage from the top of the photo.
return boolean

createAlbum() public method

Creates and returns a new album owned by the specified user or the current session user.
public createAlbum ( string $name, string $description = '', string $uid = 'me' ) : array
$name string The name of the album.
$description string (Optional) A description of the album.
$uid string (Optional) User id for creating the album; if not specified, the session user is used.
return array An album object

get() public method

Returns photos according to the filters specified.
public get ( array $filter = [], array $options = [] ) : array
$filter array An options array containing a maximum of ONE of the following values: - tagged: Filter by photos tagged with this user. - album: Filter by photos in these albums. - photos: Only return indicated photos.
$options array Additional options: - limit: (integer) The maximum number of posts to return. - offset: (integer) The post to start returning from.
return array An array of photo objects.

getAlbums() public method

Note that at least one of the (uid, aids) parameters must be specified.
public getAlbums ( integer $uid = 'me', string $aids = null ) : array
$uid integer (Optional) The uid of the user whose albums you want. A null will return the albums of the session user.
$aids string (Optional) A comma-separated list of aids to restricti the query.
return array of album objects.

getTags() public method

Return the tags for a photo.
public getTags ( string $pid ) : array
$pid string The photo id
return array An array of photo tag objects, which include pid, subject uid, and two floating-point numbers (xcoord, ycoord) for tag pixel location.

upload() public method

Uploads a photo.
public upload ( array $params = [] ) : array
$params array The parameter array. - file: (string) A local path to the file to upload. DEFAULT: None, but either 'file' or 'url' is required. - url: (string) A URL to an image to upload. DEFAULT: None, but either 'file' or 'url' is required. - aid: (string) The album id. DEFAULT: None (Will upload to the application's album). - caption: (string) The photo caption. DEFAULT: None. - place: (string) A Facebook UID of the place the photo was taken near. DEFAULT: None. - uid: (string) The Facebook UID of the user we are uploading on behalf of. DEFAULT: None (Will upload on behalf of the current user).
return array An array of user objects