Favorites

Extends \Joomla\Twitter\Object

Twitter API Favorites class for the Joomla Framework.

deprecated
since

1.0

deprecated

The joomla/twitter package is deprecated

Methods

__construct

Constructor.

__construct(array &$options, \Joomla\Http\Http $client, \Joomla\Twitter\OAuth $oauth) 
inherited
since

Arguments

$options

arrayTwitter options array.

$client

\Joomla\Http\HttpThe HTTP client object.

$oauth

\Joomla\Twitter\OAuthThe OAuth client.

checkRateLimit

Method to check the rate limit for the requesting IP address

checkRateLimit(string $resource = null, string $action = null) : void
inherited
since
throws

\RuntimeException

Arguments

$resource

stringA resource or a comma-separated list of resource families you want to know the current rate limit disposition for.

$action

stringAn action for the specified resource, if only one resource is specified.

createFavorites

Method to favorite the status specified in the ID parameter as the authenticating user

createFavorites(integer $id, boolean $entities = null) : array
since

1.0

Arguments

$id

integerThe numerical ID of the desired status.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

Response

arrayThe decoded JSON response

deleteFavorites

Method to un-favorites the status specified in the ID parameter as the authenticating user.

deleteFavorites(integer $id, boolean $entities = null) : array
since

1.0

Arguments

$id

integerThe numerical ID of the desired status.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

Response

arrayThe decoded JSON response

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, array $parameters = null) : string
inherited
since

Arguments

$path

stringURL to inflect

$parameters

arrayThe parameters passed in the URL.

Response

stringThe request URL.

getFavorites

Method to get the most recent favorite statuses for the authenticating or specified user.

getFavorites(mixed $user = null, integer $count = 20, integer $sinceId, integer $maxId, boolean $entities = null) : array
since

1.0

Arguments

$user

mixedEither an integer containing the user ID or a string containing the screen name.

$count

integerSpecifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included in the count, so it is always suggested to set $include_rts to true

$sinceId

integerReturns results with an ID greater than (that is, more recent than) the specified ID.

$maxId

integerReturns results with an ID less than (that is, older than) the specified ID.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

Response

arrayThe decoded JSON response

getOption

Get an option from the Twitter Object instance.

getOption(string $key) : mixed
inherited
since

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

getRateLimit

Method to retrieve the rate limit for the requesting IP address

getRateLimit(string $resource) : array
inherited
since

Arguments

$resource

stringA resource or a comma-separated list of resource families you want to know the current rate limit disposition for.

Response

arrayThe JSON response decoded

sendRequest

Method to send the request.

sendRequest(string $path, string $method = 'GET', mixed $data = array(), array $headers = array()) : array
inherited
since
throws

\RuntimeException

Arguments

$path

stringThe path of the request to make

$method

stringThe request method.

$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

Response

arrayThe decoded JSON response

setOption

Set an option for the Twitter Object instance.

setOption(string $key, mixed $value) : \Joomla\Twitter\AbstractTwitterObject
inherited
since

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\Joomla\Twitter\AbstractTwitterObjectThis object for method chaining.

Properties

options

Options for the Twitter object.

inherited
since

Type(s)

array

client

The HTTP client object to use in sending HTTP requests.

inherited
since

Type(s)

\Joomla\Http\Http

oauth

The OAuth client.

inherited
since

Type(s)

\Joomla\Twitter\OAuth