Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JTwitterPlaces
+ Graphe d'héritage de JTwitterPlaces:
+ Graphe de collaboration de JTwitterPlaces:

Liste de tous les membres

Fonctions membres publiques

 getPlace ($id)
 getGeocode ($lat, $long, $accuracy=null, $granularity=null, $max_results=0, $callback=null)
 search ($lat=null, $long=null, $query=null, $ip=null, $granularity=null, $accuracy=null, $max_results=0, $within=null, $attribute=null, $callback=null)
 getSimilarPlaces ($lat, $long, $name, $within=null, $attribute=null, $callback=null)
 createPlace ($lat, $long, $name, $geo_token, $within, $attribute=null, $callback=null)
- Fonctions membres publiques inherited from JTwitterObject
 __construct (JRegistry &$options=null, JHttp $client=null, JTwitterOAuth $oauth=null)
 checkRateLimit ($resource=null, $action=null)
 fetchUrl ($path, $parameters=null)
 getRateLimit ($resource)
 sendRequest ($path, $method= 'GET', $data=array(), $headers=array())
 getOption ($key)
 setOption ($key, $value)

Additional Inherited Members

- Attributs protégés inherited from JTwitterObject
 $options
 $client
 $oauth

Description détaillée

Définition à la ligne 19 du fichier places.php.


Documentation des fonctions membres

JTwitterPlaces::createPlace (   $lat,
  $long,
  $name,
  $geo_token,
  $within,
  $attribute = null,
  $callback = null 
)

Method to create a new place object at the given latitude and longitude.

Paramètres:
float$latThe latitude to search around.
float$longThe longitude to search around.
string$nameThe name a place is known as.
string$geo_tokenThe token found in the response from geo/similar_places.
string$withinThis is the place_id which you would like to restrict the search results to.
string$attributeThis parameter searches for places which have this given street address.
string$callbackIf supplied, the response will use the JSONP format with a callback of the given name.
Renvoie:
array The decoded JSON response
Depuis:
12.3

Définition à la ligne 262 du fichier places.php.

{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'place');
$data['lat'] = $lat;
$data['long'] = $long;
$data['name'] = rawurlencode($name);
$data['token'] = $geo_token;
$data['contained_within'] = $within;
// Check if attribute is specified
if ($attribute)
{
$data['attribute:street_address'] = rawurlencode($attribute);
}
// Check if callback is specified
if ($callback)
{
$data['callback'] = $callback;
}
// Set the API path
$path = '/geo/place.json';
// Send the request.
return $this->sendRequest($path, 'POST', $data);
}
JTwitterPlaces::getGeocode (   $lat,
  $long,
  $accuracy = null,
  $granularity = null,
  $max_results = 0,
  $callback = null 
)

Method to get up to 20 places that can be used as a place_id when updating a status.

Paramètres:
float$latThe latitude to search around.
float$longThe longitude to search around.
string$accuracyA hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet.
string$granularityThis is the minimal granularity of place types to return and must be one of: poi, neighborhood, city, admin or country.
integer$max_resultsA hint as to the number of results to return.
string$callbackIf supplied, the response will use the JSONP format with a callback of the given name.
Renvoie:
array The decoded JSON response
Depuis:
12.3

Définition à la ligne 58 du fichier places.php.

{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'reverse_geocode');
// Set the API path
$path = '/geo/reverse_geocode.json';
// Set the request parameters
$data['lat'] = $lat;
$data['long'] = $long;
// Check if accuracy is specified
if ($accuracy)
{
$data['accuracy'] = $accuracy;
}
// Check if granularity is specified
if ($granularity)
{
$data['granularity'] = $granularity;
}
// Check if max_results is specified
if ($max_results)
{
$data['max_results'] = $max_results;
}
// Check if callback is specified
if ($callback)
{
$data['callback'] = $callback;
}
// Send the request.
return $this->sendRequest($path, 'GET', $data);
}
JTwitterPlaces::getPlace (   $id)

Method to get all the information about a known place.

Paramètres:
string$idA place in the world. These IDs can be retrieved using getGeocode.
Renvoie:
array The decoded JSON response
Depuis:
12.3

Définition à la ligne 30 du fichier places.php.

{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'id/:place_id');
// Set the API path
$path = '/geo/id/' . $id . '.json';
// Send the request.
return $this->sendRequest($path);
}
JTwitterPlaces::getSimilarPlaces (   $lat,
  $long,
  $name,
  $within = null,
  $attribute = null,
  $callback = null 
)

Method to locate places near the given coordinates which are similar in name.

Paramètres:
float$latThe latitude to search around.
float$longThe longitude to search around.
string$nameThe name a place is known as.
string$withinThis is the place_id which you would like to restrict the search results to.
string$attributeThis parameter searches for places which have this given street address.
string$callbackIf supplied, the response will use the JSONP format with a callback of the given name.
Renvoie:
array The decoded JSON response
Depuis:
12.3

Définition à la ligne 213 du fichier places.php.

{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'similar_places');
// Set the API path
$path = '/geo/similar_places.json';
$data['lat'] = $lat;
$data['long'] = $long;
$data['name'] = rawurlencode($name);
// Check if within is specified
if ($within)
{
$data['contained_within'] = $within;
}
// Check if attribute is specified
if ($attribute)
{
$data['attribute:street_address'] = rawurlencode($attribute);
}
// Check if callback is specified
if ($callback)
{
$data['callback'] = $callback;
}
// Send the request.
return $this->sendRequest($path, 'GET', $data);
}
JTwitterPlaces::search (   $lat = null,
  $long = null,
  $query = null,
  $ip = null,
  $granularity = null,
  $accuracy = null,
  $max_results = 0,
  $within = null,
  $attribute = null,
  $callback = null 
)

Method to search for places that can be attached to a statuses/update.

Paramètres:
float$latThe latitude to search around.
float$longThe longitude to search around.
string$queryFree-form text to match against while executing a geo-based query, best suited for finding nearby locations by name.
string$ipAn IP address.
string$granularityThis is the minimal granularity of place types to return and must be one of: poi, neighborhood, city, admin or country.
string$accuracyA hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet.
integer$max_resultsA hint as to the number of results to return.
string$withinThis is the place_id which you would like to restrict the search results to.
string$attributeThis parameter searches for places which have this given street address.
string$callbackIf supplied, the response will use the JSONP format with a callback of the given name.
Renvoie:
array The decoded JSON response
Depuis:
12.3
Exceptions:
RuntimeException

Définition à la ligne 120 du fichier places.php.

{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'search');
// Set the API path
$path = '/geo/search.json';
// At least one of the following parameters must be provided: lat, long, ip, or query.
if ($lat == null && $long == null && $ip == null && $query == null)
{
throw new RuntimeException('At least one of the following parameters must be provided: lat, long, ip, or query.');
}
// Check if lat is specified.
if ($lat)
{
$data['lat'] = $lat;
}
// Check if long is specified.
if ($long)
{
$data['long'] = $long;
}
// Check if query is specified.
if ($query)
{
$data['query'] = rawurlencode($query);
}
// Check if ip is specified.
if ($ip)
{
$data['ip'] = $ip;
}
// Check if granularity is specified
if ($granularity)
{
$data['granularity'] = $granularity;
}
// Check if accuracy is specified
if ($accuracy)
{
$data['accuracy'] = $accuracy;
}
// Check if max_results is specified
if ($max_results)
{
$data['max_results'] = $max_results;
}
// Check if within is specified
if ($within)
{
$data['contained_within'] = $within;
}
// Check if attribute is specified
if ($attribute)
{
$data['attribute:street_address'] = rawurlencode($attribute);
}
// Check if callback is specified
if ($callback)
{
$data['callback'] = $callback;
}
// Send the request.
return $this->sendRequest($path, 'GET', $data);
}

La documentation de cette classe a été générée à partir du fichier suivant :