Alternc  latest
Alternc logiel libre pour l'hébergement
 All Classes Namespaces Files Functions Variables Pages
Alternc_Api_Response Class Reference

Standard Response object for the AlternC API. More...

Public Member Functions

 __construct ($options=array())
 initialize a response object More...
 
 toJson ()
 Formats response to json. More...
 

Public Attributes

const ERR_DISABLED_ACCOUNT = 221801
 Error codes. More...
 
const ERR_INVALID_AUTH = 221802
 
 $code
 
 $message
 
 $content
 
 $metadata
 

Detailed Description

Standard Response object for the AlternC API.

Definition at line 7 of file Response.php.

Constructor & Destructor Documentation

Alternc_Api_Response::__construct (   $options = array())

initialize a response object

Parameters
optionsany of the public above

Definition at line 47 of file Response.php.

47  {
48  $os = array("code", "message", "content", "metadata");
49  foreach ($os as $o) {
50  if (isset($options[$o]))
51  $this->$o = $options[$o];
52  }
53  }

Member Function Documentation

Alternc_Api_Response::toJson ( )

Formats response to json.

Returns
string

Definition at line 60 of file Response.php.

60  {
61  return json_encode(get_object_vars($this));
62  }

Member Data Documentation

Alternc_Api_Response::$code

Definition at line 20 of file Response.php.

Alternc_Api_Response::$content

Definition at line 34 of file Response.php.

Alternc_Api_Response::$message

Definition at line 27 of file Response.php.

Alternc_Api_Response::$metadata

Definition at line 41 of file Response.php.

const Alternc_Api_Response::ERR_DISABLED_ACCOUNT = 221801

Error codes.

Definition at line 12 of file Response.php.

const Alternc_Api_Response::ERR_INVALID_AUTH = 221802

Definition at line 13 of file Response.php.


The documentation for this class was generated from the following file: