-
Notifications
You must be signed in to change notification settings - Fork 3
DonDominioResponse
An object representing the response from a command issued to the DonDominio API. Returned by the Wrapper modules of the DonDominioAPI class.
$dondominio = new DonDominioAPI(array(
'apiuser' => '00000-XXX',
'apipasswd' => 'XXXXXXXXXXXX'
));
$response = $dondominio->domain_check('example.com');
/*
* Will output:
* Array
* (
* [domains] => Array
* (
* [0] => Array
* (
* [name] => example.com
* [punycode] => example.com
* [tld] => com
* [available] => bool(false)
* [premium] => bool(false)
* [price] => 9.95
* [currency] => EUR
* )
*
* )
*
* )
*/
print_r($response->output('Array'));Returns whether the command was a success or not.
boolean success ()None
Returns true if the command was a success, false otherwise.
Gets the error code returned by the API, if any.
integer getErrorCode ()None
The error code returned by the API, if any.
Gets the error message associated to the error code returned by the API, if any.
string getErrorCodeMsg ()None
The error message associated to the error code returned by the API, if any.
Gets the original command name (action) issued to the API.
string getAction ()None
The command name (action) issued to the API.
Gets the API version that responded to the command issued.
string getVersion ()None
The API version that responded to the command issued.
Returns the data included with the API's response.
array getResponseData ()None
An Array containing the information returned by the API. Check the documentation of each module to know which fields are returned by every call.
Returns a single item from the response data returned by the API.
mixed get ( string $key )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| key | string | Yes | Name of the field to get the value from |
The value stored in the array item returned from the API identified by $key. If $key is not found in the array, this method will return false.
Returns the original response, as sent by the API.
string getRawResponse ()None
The original response, as returned by the API command issued. Usually, this is a JSON string.
Outputs the response from the DonDominio API in the specified format.
mixed output ( string $format [, array $options = array() ] )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| format | string | Yes | Output Filter chosen for the output information | |
| options | array | No | Associative array of options for the output filter |
The response from the DonDominio API in the chosen format. More information about output filters is available on the Output Filters section of this Wiki.