Class Golem_Request

Description

Base class for accessing the golem.de web interface

Located in /Request.php (line 52)


	
			
Class Constant Summary
Variable Summary
Array $data
Integer $errorCode
String $errorMessage
String $key
Array $params
String $url
Method Summary
Golem_Request __construct ([String $key = null], [String $url = null], [Array $params = array()])
Boolean doRequest ([Array $curlOptions = array()])
Mixed getData ()
Integer getErrorCode ()
String getErrorMessage ()
Variables
Array $data = null (line 101)

The decoded JSON data

  • access: protected
Integer $errorCode = -1 (line 113)

The error code returned by the request

  • access: protected
String $errorMessage = '' (line 119)

The error message returned by the request

  • access: protected
String $key = null (line 107)

The developer access key

  • access: protected
Array $params = array() (line 95)

The additional parameters for the url request

  • access: protected
String $url = null (line 89)

The url to use for request

  • access: protected
Methods
Constructor __construct (line 128)

Creates a request object

  • access: public
Golem_Request __construct ([String $key = null], [String $url = null], [Array $params = array()])
  • String $key: your developer key
  • String $url: the URL to request
  • Array $params: additional parameters for the request
doRequest (line 194)

Does the HTTP request.

The URL service is called and the result is decoded from JSON into a usable datastructure.

If the the method returns true, you can get the data from getData().

If the method returns false, you can check the reason by using getErrorCode() and getErrorMessage().

  • return: true if request was successful, false if failed
  • access: public
Boolean doRequest ([Array $curlOptions = array()])
  • Array $curlOptions: Array of Options passed to curl_setopt() the array keys are used as curl option
getData (line 296)

Returns the data from the request.

The content of the data depends on the requested service.

The returned value is not determined, if the request failed.

  • return: the request result
  • access: public
Mixed getData ()
getErrorCode (line 149)

Returns the error code of a failed request.

The value returns the error code after a request failed. Except of '0' for a failed HTTP request, the error code is always URL service spezific.

If this method is called after a successful operation the return value is not determined.

  • return: the error code
  • access: public
Integer getErrorCode ()
getErrorMessage (line 168)

Returns the error message of a failed request.

The value returns the error message after a request failed. Except for a failed HTTP request, the error message is always URL service spezific.

If this method is called after a successful operation the return value is not determined.

  • return: the error message
  • access: public
String getErrorMessage ()
Class Constants
ERROR_DATABASE = 1 (line 58)

An error caused by a failing data access

ERROR_KEYAUTH_FAILED = 4 (line 73)

Authentication of developer key failed

ERROR_KEYAUTH_LIMIT_EXCEEDED = 6 (line 83)

Developer key was used too often and reached the access limit

ERROR_KEYAUTH_NOT_ENABLED = 5 (line 78)

Developer key can't be used currently

ERROR_KEYAUTH_NOT_PROVIDED = 2 (line 63)

No developer key was provided

ERROR_KEYAUTH_NOT_VALID = 3 (line 68)

Developer key does not looks like one

Documentation generated on Tue, 20 Apr 2010 14:21:07 +0200 by phpDocumentor 1.4.3