class JFacebookPhoto extends JFacebookObject

Facebook API Photo class for the Joomla Platform.

Methods

__construct( Registry $options = null, JHttp $client = null, JFacebookOAuth $oauth = null)

Constructor.

mixed
sendRequest( string $path, mixed $data = '', array $headers = null, integer $limit, integer $offset, string $until = null, string $since = null)

Method to send the request.

mixed
get( string $object)

Method to get an object.

mixed
getConnection( string $object, string $connection = null, string $extra_fields = '', integer $limit, integer $offset, string $until = null, string $since = null)

Method to get object's connection.

mixed
createConnection( string $object, string $connection = null, array $parameters = null, array $headers = null)

Method to create a connection.

mixed
deleteConnection( string $object, string $connection = null, string $extra_fields = '')

Method to delete a connection.

setOAuth( JFacebookOAuth $oauth)

Method used to set the OAuth client.

getOAuth()

Method used to get the OAuth client.

mixed
getPhoto( string $photo)

Method to get a photo. Requires authentication and userphotos or friendsphotos permission for private photos.

mixed
getComments( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get a photo's comments. Requires authentication and userphotos or friendsphotos permission for private photos.

mixed
createComment( string $photo, string $message)

Method to comment on a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

boolean
deleteComment( string $comment)

Method to delete a comment. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

mixed
getLikes( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get photo's likes. Requires authentication and userphotos or friendsphotos permission for private photos.

boolean
createLike( string $photo)

Method to like a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

boolean
deleteLike( string $photo)

Method to unlike a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

mixed
getTags( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get the Users tagged in the photo. Requires authentication and userphotos or friendsphotos permission for private photos.

boolean
createTag( string $photo, mixed $to = null, string $tag_text = null, integer $x = null, integer $y = null)

Method to tag one or more Users in a photo. $to or $tag_text required.

boolean
updateTag( string $photo, string $to, integer $x = null, integer $y = null)

Method to update the position of the tag for a particular Users in a photo.

string
getPicture( string $photo, boolean $redirect = true)

Method to get the album-sized view of the photo. Requires authentication and userphotos or friendsphotos permission for private photos.

Details

__construct( Registry $options = null, JHttp $client = null, JFacebookOAuth $oauth = null)

Constructor.

Parameters

Registry $options Facebook options object.
JHttp $client The HTTP client object.
JFacebookOAuth $oauth The OAuth client.

mixed sendRequest( string $path, mixed $data = '', array $headers = null, integer $limit, integer $offset, string $until = null, string $since = null)

Method to send the request.

Parameters

string $path The path of the request to make.
mixed $data Either an associative array or a string to be sent with the post request.
array $headers An array of name-value pairs to include in the header of the request
integer $limit The number of objects per page.
integer $offset The object's number on the page.
string $until A unix timestamp or any date accepted by strtotime.
string $since A unix timestamp or any date accepted by strtotime.

Return Value

mixed The request response.

Exceptions

DomainException

mixed get( string $object)

Method to get an object.

Parameters

string $object The object id.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

mixed getConnection( string $object, string $connection = null, string $extra_fields = '', integer $limit, integer $offset, string $until = null, string $since = null)

Method to get object's connection.

Parameters

string $object The object id.
string $connection The object's connection name.
string $extra_fields URL fields.
integer $limit The number of objects per page.
integer $offset The object's number on the page.
string $until A unix timestamp or any date accepted by strtotime.
string $since A unix timestamp or any date accepted by strtotime.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

mixed createConnection( string $object, string $connection = null, array $parameters = null, array $headers = null)

Method to create a connection.

Parameters

string $object The object id.
string $connection The object's connection name.
array $parameters The POST request parameters.
array $headers An array of name-value pairs to include in the header of the request

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

mixed deleteConnection( string $object, string $connection = null, string $extra_fields = '')

Method to delete a connection.

Parameters

string $object The object id.
string $connection The object's connection name.
string $extra_fields URL fields.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

JFacebookObject setOAuth( JFacebookOAuth $oauth)

Method used to set the OAuth client.

Parameters

JFacebookOAuth $oauth The OAuth client object.

Return Value

JFacebookObject This object for method chaining.

JFacebookOAuth getOAuth()

Method used to get the OAuth client.

Return Value

JFacebookOAuth The OAuth client

mixed getPhoto( string $photo)

Method to get a photo. Requires authentication and userphotos or friendsphotos permission for private photos.

Parameters

string $photo The photo id.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

mixed getComments( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get a photo's comments. Requires authentication and userphotos or friendsphotos permission for private photos.

Parameters

string $photo The photo id.
integer $limit The number of objects per page.
integer $offset The object's number on the page.
string $until A unix timestamp or any date accepted by strtotime.
string $since A unix timestamp or any date accepted by strtotime.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

mixed createComment( string $photo, string $message)

Method to comment on a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

Parameters

string $photo The photo id.
string $message The comment's text.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

boolean deleteComment( string $comment)

Method to delete a comment. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

Parameters

string $comment The comment's id.

Return Value

boolean Returns true if successful, and false otherwise.

mixed getLikes( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get photo's likes. Requires authentication and userphotos or friendsphotos permission for private photos.

Parameters

string $photo The photo id.
integer $limit The number of objects per page.
integer $offset The object's number on the page.
string $until A unix timestamp or any date accepted by strtotime.
string $since A unix timestamp or any date accepted by strtotime.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

boolean createLike( string $photo)

Method to like a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

Parameters

string $photo The photo id.

Return Value

boolean Returns true if successful, and false otherwise.

boolean deleteLike( string $photo)

Method to unlike a photo. Requires authentication and publishstream permission, userphotos or friends_photos permission for private photos.

Parameters

string $photo The photo id.

Return Value

boolean Returns true if successful, and false otherwise.

mixed getTags( string $photo, integer $limit, integer $offset, string $until = null, string $since = null)

Method to get the Users tagged in the photo. Requires authentication and userphotos or friendsphotos permission for private photos.

Parameters

string $photo The photo id.
integer $limit The number of objects per page.
integer $offset The object's number on the page.
string $until A unix timestamp or any date accepted by strtotime.
string $since A unix timestamp or any date accepted by strtotime.

Return Value

mixed The decoded JSON response or false if the client is not authenticated.

boolean createTag( string $photo, mixed $to = null, string $tag_text = null, integer $x = null, integer $y = null)

Method to tag one or more Users in a photo. $to or $tag_text required.

Requires authentication and publishstream permission, userphotos permission for private photos.

Parameters

string $photo The photo id.
mixed $to ID of the User or an array of Users to tag in the photo: [{"id":"1234"}, {"id":"12345"}].
string $tag_text A text string to tag.
integer $x x coordinate of tag, as a percentage offset from the left edge of the picture.
integer $y y coordinate of tag, as a percentage offset from the top edge of the picture.

Return Value

boolean Returns true if successful, and false otherwise.

boolean updateTag( string $photo, string $to, integer $x = null, integer $y = null)

Method to update the position of the tag for a particular Users in a photo.

Requires authentication and publishstream permission, userphotos permission for private photos.

Parameters

string $photo The photo id.
string $to ID of the User to update tag in the photo.
integer $x x coordinate of tag, as a percentage offset from the left edge of the picture.
integer $y y coordinate of tag, as a percentage offset from the top edge of the picture.

Return Value

boolean Returns true if successful, and false otherwise.

string getPicture( string $photo, boolean $redirect = true)

Method to get the album-sized view of the photo. Requires authentication and userphotos or friendsphotos permission for private photos.

Parameters

string $photo The photo id.
boolean $redirect If false this will return the URL of the picture without a 302 redirect.

Return Value

string URL of the picture.