class JOpenstreetmapUser extends JOpenstreetmapObject

Openstreetmap API User class for the Joomla Platform

Methods

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

Constructor

mixed
getOption( string $key)

Get an option from the JOpenstreetmapObject instance.

setOption( string $key, mixed $value)

Set an option for the JOpenstreetmapObject instance.

sendRequest( string $path, string $method = 'GET', array $headers = array(), mixed $data = '')

Method to send the request which does not require authentication.

array
getDetails()

Method to get user details

array
getPreferences()

Method to get preferences

array
replacePreferences( array $preferences)

Method to replace user preferences

array
changePreference( string $key, string $preference)

Method to change user preferences

Details

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

Constructor

Parameters

Registry $options &$options Openstreetmap options object.
JHttp $client The HTTP client object.
JOpenstreetmapOauth $oauth Openstreetmap oauth client

mixed getOption( string $key)

Get an option from the JOpenstreetmapObject instance.

Parameters

string $key The name of the option to get.

Return Value

mixed The option value.

JOpenstreetmapObject setOption( string $key, mixed $value)

Set an option for the JOpenstreetmapObject instance.

Parameters

string $key The name of the option to set.
mixed $value The option value to set.

Return Value

JOpenstreetmapObject This object for method chaining.

SimpleXMLElement sendRequest( string $path, string $method = 'GET', array $headers = array(), mixed $data = '')

Method to send the request which does not require authentication.

Parameters

string $path The path of the request to make
string $method The request method.
array $headers The headers passed in the request.
mixed $data Either an associative array or a string to be sent with the post request.

Return Value

SimpleXMLElement The XML response

Exceptions

DomainException

array getDetails()

Method to get user details

Return Value

array The XML response

array getPreferences()

Method to get preferences

Return Value

array The XML response

array replacePreferences( array $preferences)

Method to replace user preferences

Parameters

array $preferences Array of new preferences

Return Value

array The XML response

array changePreference( string $key, string $preference)

Method to change user preferences

Parameters

string $key Key of the preference
string $preference New value for preference

Return Value

array The XML response