Liste de tous les membres
Fonctions membres publiques |
| __construct (JRegistry $options=null, JHttp $client=null, JFacebookOAuth $oauth=null) |
| sendRequest ($path, $data= '', array $headers=null, $limit=0, $offset=0, $until=null, $since=null) |
| get ($object) |
| getConnection ($object, $connection=null, $extra_fields= '', $limit=0, $offset=0, $until=null, $since=null) |
| createConnection ($object, $connection=null, $parameters=null, array $headers=null) |
| deleteConnection ($object, $connection=null, $extra_fields= '') |
| setOAuth ($oauth) |
| getOAuth () |
Fonctions membres protégées |
| fetchUrl ($path, $limit=0, $offset=0, $until=null, $since=null) |
Description détaillée
Définition à la ligne 22 du fichier object.php.
Documentation des constructeurs et destructeur
Constructor.
- Paramètres:
-
- Depuis:
- 13.1
Définition à la ligne 51 du fichier object.php.
{
$this->options = isset($options) ? $options :
new JRegistry;
$this->client = isset($client) ? $client :
new JHttp($this->options);
}
Documentation des fonctions membres
JFacebookObject::createConnection |
( |
|
$object, |
|
|
|
$connection = null , |
|
|
|
$parameters = null , |
|
|
array |
$headers = null |
|
) |
| |
Method to create a connection.
- Paramètres:
-
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 |
- Renvoie:
- mixed The decoded JSON response or false if the client is not authenticated.
- Depuis:
- 13.1
Définition à la ligne 218 du fichier object.php.
{
if ($this->oauth->isAuthenticated())
{
if ($connection != null)
{
$path = $object . '/' . $connection;
}
else
{
$path = $object;
}
$response = $this->oauth->query($this->
fetchUrl($path), $parameters, $headers,
'post');
return json_decode($response->body);
}
else
{
return false;
}
}
JFacebookObject::deleteConnection |
( |
|
$object, |
|
|
|
$connection = null , |
|
|
|
$extra_fields = '' |
|
) |
| |
Method to delete a connection.
- Paramètres:
-
string | $object | The object id. |
string | $connection | The object's connection name. |
string | $extra_fields | URL fields. |
- Renvoie:
- mixed The decoded JSON response or false if the client is not authenticated.
- Depuis:
- 13.1
Définition à la ligne 254 du fichier object.php.
{
if ($this->oauth->isAuthenticated())
{
if ($connection != null)
{
$path = $object . '/' . $connection . $extra_fields;
}
else
{
$path = $object . $extra_fields;
}
$response = $this->oauth->query($this->
fetchUrl($path), null, array(),
'delete');
return json_decode($response->body);
}
else
{
return false;
}
}
JFacebookObject::fetchUrl |
( |
|
$path, |
|
|
|
$limit = 0 , |
|
|
|
$offset = 0 , |
|
|
|
$until = null , |
|
|
|
$since = null |
|
) |
| |
|
protected |
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.
- Paramètres:
-
string | $path | URL to inflect. |
integer | $limit | The number of objects per page. |
integer | $offset | The object's number on the page. |
timestamp | $until | A unix timestamp or any date accepted by strtotime. |
timestamp | $since | A unix timestamp or any date accepted by strtotime. |
- Renvoie:
- string The request URL.
- Depuis:
- 13.1
Définition à la ligne 73 du fichier object.php.
Références JUri\setVar().
{
$uri =
new JUri($this->options->get(
'api.url') . $path);
if ($limit > 0)
{
$uri->
setVar(
'limit', (
int) $limit);
}
if ($offset > 0)
{
$uri->setVar('offset', (int) $offset);
}
if ($until != null)
{
$uri->setVar('until', $until);
}
if ($since != null)
{
$uri->setVar('since', $since);
}
return (string) $uri;
}
JFacebookObject::get |
( |
|
$object | ) |
|
Method to get an object.
- Paramètres:
-
string | $object | The object id. |
- Renvoie:
- mixed The decoded JSON response or false if the client is not authenticated.
- Depuis:
- 13.1
Définition à la ligne 142 du fichier object.php.
{
if ($this->oauth != null)
{
if ($this->oauth->isAuthenticated())
{
$response = $this->oauth->query($this->
fetchUrl($object));
return json_decode($response->body);
}
else
{
return false;
}
}
}
JFacebookObject::getConnection |
( |
|
$object, |
|
|
|
$connection = null , |
|
|
|
$extra_fields = '' , |
|
|
|
$limit = 0 , |
|
|
|
$offset = 0 , |
|
|
|
$until = null , |
|
|
|
$since = null |
|
) |
| |
Method to get object's connection.
- Paramètres:
-
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. |
- Renvoie:
- mixed The decoded JSON response or false if the client is not authenticated.
- Depuis:
- 13.1
Définition à la ligne 177 du fichier object.php.
{
$path = $object . '/' . $connection . $extra_fields;
if ($this->oauth != null)
{
if ($this->oauth->isAuthenticated())
{
$response = $this->oauth->query($this->
fetchUrl($path, $limit, $offset, $until, $since));
if (strcmp($response->body, ''))
{
return json_decode($response->body);
}
else
{
return $response->headers['Location'];
}
}
else
{
return false;
}
}
return $this->
sendRequest($path,
'', null, $limit, $offset, $until, $since);
}
JFacebookObject::getOAuth |
( |
| ) |
|
Method used to get the OAuth client.
- Renvoie:
- JFacebookOAuth The OAuth client
- Depuis:
- 13.1
Définition à la ligne 302 du fichier object.php.
JFacebookObject::sendRequest |
( |
|
$path, |
|
|
|
$data = '' , |
|
|
array |
$headers = null , |
|
|
|
$limit = 0 , |
|
|
|
$offset = 0 , |
|
|
|
$until = null , |
|
|
|
$since = null |
|
) |
| |
Method to send the request.
- Paramètres:
-
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. |
- Renvoie:
- mixed The request response.
- Depuis:
- 13.1
- Exceptions:
-
Définition à la ligne 117 du fichier object.php.
{
$response = $this->client->get($this->
fetchUrl($path, $limit, $offset, $until, $since), $headers);
$response = json_decode($response->body);
if (property_exists($response, 'error'))
{
throw new RuntimeException($response->error->message);
}
return $response;
}
JFacebookObject::setOAuth |
( |
|
$oauth | ) |
|
Method used to set the OAuth client.
- Paramètres:
-
- Renvoie:
- JFacebookObject This object for method chaining.
- Depuis:
- 13.1
Définition à la ligne 288 du fichier object.php.
Documentation des données membres
JFacebookObject::$options |
|
protected |
La documentation de cette classe a été générée à partir du fichier suivant :