Public Member Functions | Data Fields | Protected Attributes

Zend_Json_Server_Error Class Reference

Public Member Functions

 __construct ($message=null, $code=-32000, $data=null)
 setCode ($code)
 getCode ()
 setMessage ($message)
 getMessage ()
 setData ($data)
 getData ()
 toArray ()
 toJson ()
 __toString ()

Data Fields

const ERROR_PARSE = -32768
const ERROR_INVALID_REQUEST = -32600
const ERROR_INVALID_METHOD = -32601
const ERROR_INVALID_PARAMS = -32602
const ERROR_INTERNAL = -32603
const ERROR_OTHER = -32000

Protected Attributes

 $_allowedCodes
 $_code = -32000
 $_data
 $_message

Detailed Description

Definition at line 28 of file Error.php.


Constructor & Destructor Documentation

__construct ( message = null,
code = -32000,
data = null 
)

Constructor

Parameters:
string$message
int$code
mixed$data
Returns:
void

Definition at line 76 of file Error.php.


Member Function Documentation

__toString (  )

Cast to string (JSON)

Returns:
string

Definition at line 193 of file Error.php.

getCode (  )

Get error code

Returns:
int|null

Definition at line 110 of file Error.php.

getData (  )

Get error data

Returns:
mixed

Definition at line 158 of file Error.php.

getMessage (  )

Get error message

Returns:
string

Definition at line 136 of file Error.php.

setCode ( code )

Set error code

Parameters:
int$code
Returns:
Zend_Json_Server_Error

Definition at line 89 of file Error.php.

setData ( data )

Set error data

Parameters:
mixed$data
Returns:
Zend_Json_Server_Error

Definition at line 147 of file Error.php.

setMessage ( message )

Set error message

Parameters:
string$message
Returns:
Zend_Json_Server_Error

Definition at line 121 of file Error.php.

toArray (  )

Cast error to array

Returns:
array

Definition at line 168 of file Error.php.

toJson (  )

Cast error to JSON

Returns:
string

Definition at line 182 of file Error.php.


Field Documentation

$_allowedCodes [protected]
Initial value:
 array(
        self::ERROR_PARSE,
        self::ERROR_INVALID_REQUEST,
        self::ERROR_INVALID_METHOD,
        self::ERROR_INVALID_PARAMS,
        self::ERROR_INTERNAL,
        self::ERROR_OTHER,
    )

Definition at line 41 of file Error.php.


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