Photo

Extends \Joomla\Facebook\Object

Facebook API Photo class for the Joomla Framework.

deprecated
link

https://developers.facebook.com/docs/reference/api/photo/

since

1.0

deprecated

The joomla/facebook package is deprecated

Methods

__construct

Constructor.

__construct(array $options = array(), \Joomla\Http\Http $client = null, \Joomla\Facebook\OAuth $oauth = null) 
inherited
since

1.2.0

Arguments

$options

arrayFacebook options array.

$client

\Joomla\Http\HttpThe HTTP client object.

$oauth

\Joomla\Facebook\OAuthThe OAuth client.

createComment

Method to comment on a photo.

createComment(string $photo, string $message) : mixed

Requires authentication and publish_stream permission, user_photos or friends_photos permission for private photos.

since

1.0

Arguments

$photo

stringThe photo id.

$message

stringThe comment's text.

Response

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

createConnection

Method to create a connection.

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

1.2.0

Arguments

$object

stringThe object id.

$connection

stringThe object's connection name.

$parameters

arrayThe POST request parameters.

$headers

arrayAn array of name-value pairs to include in the header of the request

Response

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

createLike

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

createLike(string $photo) : boolean
since

1.0

Arguments

$photo

stringThe photo id.

Response

booleanReturns true if successful, and false otherwise.

createTag

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

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

Requires authentication and publish_stream permission, user_photos permission for private photos.

since

1.0

Arguments

$photo

stringThe photo id.

$to

mixedID of the User or an array of Users to tag in the photo: [{"id":"1234"}, {"id":"12345"}].

$tagText

stringA text string to tag.

$x

integerx coordinate of tag, as a percentage offset from the left edge of the picture.

$y

integery coordinate of tag, as a percentage offset from the top edge of the picture.

Response

booleanReturns true if successful, and false otherwise.

deleteComment

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

deleteComment(string $comment) : boolean
since

1.0

Arguments

$comment

stringThe comment's id.

Response

booleanReturns true if successful, and false otherwise.

deleteConnection

Method to delete a connection.

deleteConnection(string $object, string $connection = null, string $extraFields = '') : mixed
inherited
since

1.2.0

Arguments

$object

stringThe object id.

$connection

stringThe object's connection name.

$extraFields

stringURL fields.

Response

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

deleteLike

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

deleteLike(string $photo) : boolean
since

1.0

Arguments

$photo

stringThe photo id.

Response

booleanReturns true if successful, and false otherwise.

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $limit, integer $offset, string $until = null, string $since = null) : string
inherited
since

1.2.0

Arguments

$path

stringURL to inflect.

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

stringThe request URL.

get

Method to get an object.

get(string $object) : mixed
inherited
since

1.2.0

Arguments

$object

stringThe object id.

Response

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

getComments

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

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

1.0

Arguments

$photo

stringThe photo id.

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

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

getConnection

Method to get object's connection.

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

1.2.0

Arguments

$object

stringThe object id.

$connection

stringThe object's connection name.

$extraFields

stringURL fields.

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

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

getLikes

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

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

1.0

Arguments

$photo

stringThe photo id.

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

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

getOauth

Method used to get the OAuth client.

getOauth() : \Joomla\Facebook\OAuth
inherited
since

1.2.0

Response

\Joomla\Facebook\OAuthThe OAuth client

getPhoto

Method to get a photo. Requires authentication and user_photos or friends_photos permission for private photos.

getPhoto(string $photo) : mixed
since

1.0

Arguments

$photo

stringThe photo id.

Response

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

getPicture

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

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

1.0

Arguments

$photo

stringThe photo id.

$redirect

booleanIf false this will return the URL of the picture without a 302 redirect.

Response

stringURL of the picture.

getTags

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

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

1.0

Arguments

$photo

stringThe photo id.

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

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

sendRequest

Method to send the request.

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

1.2.0

throws

\RuntimeException

Arguments

$path

stringThe path of the request to make.

$data

mixedEither an associative array or a string to be sent with the post request.

$headers

arrayAn array of name-value pairs to include in the header of the request

$limit

integerThe number of objects per page.

$offset

integerThe object's number on the page.

$until

stringA unix timestamp or any date accepted by strtotime.

$since

stringA unix timestamp or any date accepted by strtotime.

Response

mixedThe request response.

setOauth

Method used to set the OAuth client.

setOauth(\Joomla\Facebook\OAuth $oauth) : \Joomla\Facebook\AbstractFacebookObject
inherited
since

1.2.0

Arguments

$oauth

\Joomla\Facebook\OAuthThe OAuth client object.

Response

\Joomla\Facebook\AbstractFacebookObjectThis object for method chaining.

updateTag

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

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

Requires authentication and publish_stream permission, user_photos permission for private photos.

since

1.0

Arguments

$photo

stringThe photo id.

$to

stringID of the User to update tag in the photo.

$x

integerx coordinate of tag, as a percentage offset from the left edge of the picture.

$y

integery coordinate of tag, as a percentage offset from the top edge of the picture.

Response

booleanReturns true if successful, and false otherwise.

Properties

options

Options for the Facebook object.

inherited
since

1.2.0

Type(s)

array

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.2.0

Type(s)

\Joomla\Http\Http

oauth

The OAuth client.

inherited
since

1.2.0

Type(s)

\Joomla\Facebook\OAuth