\Horde_Service_Facebook_Photos

Photos methods for Horde_Service_Facebook

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

Summary

Methods
Properties
Constants
__construct()
addTag()
createAlbum()
get()
getAlbums()
getTags()
upload()
No public properties found
No constants found
No protected methods found
$_facebook
$_http
N/A
No private methods found
No private properties found
N/A

Properties

$_http

$_http : \Horde_Http_Client

Type

\Horde_Http_Client

Methods

__construct()

__construct(\Horde_Service_Facebook  $facebook) 

Constructor

Parameters

\Horde_Service_Facebook $facebook

addTag()

addTag(string  $pid, array  $options = array()) : boolean

Adds a tag with the given information to a photo. See the wiki for details:

http://wiki.developers.facebook.com/index.php/Photos.addTag

Parameters

string $pid

The ID of the photo to be tagged

array $options

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.

Returns

boolean

createAlbum()

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.

Parameters

string $name

The name of the album.

string $description

(Optional) A description of the album.

string $uid

(Optional) User id for creating the album; if not specified, the session user is used.

Returns

array —

An album object

get()

get(array  $filter = array(), array  $options = array()) : array

Returns photos according to the filters specified.

Parameters

array $filter

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.
array $options

Additional options:

  • limit: (integer) The maximum number of posts to return.
  • offset: (integer) The post to start returning from.

Returns

array —

An array of photo objects.

getAlbums()

getAlbums(integer  $uid = 'me', string  $aids = null) : array

Returns the albums created by the given user.

Note that at least one of the (uid, aids) parameters must be specified.

Parameters

integer $uid

(Optional) The uid of the user whose albums you want. A null will return the albums of the session user.

string $aids

(Optional) A comma-separated list of aids to restricti the query.

Returns

array —

of album objects.

getTags()

getTags(string  $pid) : array

Return the tags for a photo.

Parameters

string $pid

The photo id

Returns

array —

An array of photo tag objects, which include pid, subject uid, and two floating-point numbers (xcoord, ycoord) for tag pixel location.

upload()

upload(array  $params = array()) : array

Uploads a photo.

Parameters

array $params

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).

Returns

array —

An array of user objects