Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Json_Server_Error Class Reference

Public Member Functions

 __construct ($message=null, $code=-32000, $data=null)
 Constructor.
 
 setCode ($code)
 Set error code.
 
 getCode ()
 Get error code.
 
 setMessage ($message)
 Set error message.
 
 getMessage ()
 Get error message.
 
 setData ($data)
 Set error data.
 
 getData ()
 Get error data.
 
 toArray ()
 Cast error to array.
 
 toJson ()
 Cast error to JSON.
 
 __toString ()
 Cast to string (JSON)
 

Public Attributes

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
 

Constructor & Destructor Documentation

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

Constructor.

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

Member Function Documentation

__toString ( )

Cast to string (JSON)

Returns
string
getCode ( )

Get error code.

Returns
int|null
getData ( )

Get error data.

Returns
mixed
getMessage ( )

Get error message.

Returns
string
setCode (   $code)

Set error code.

Parameters
int$code
Returns
Zend_Json_Server_Error
setData (   $data)

Set error data.

Parameters
mixed$data
Returns
Zend_Json_Server_Error
setMessage (   $message)

Set error message.

Parameters
string$message
Returns
Zend_Json_Server_Error
toArray ( )

Cast error to array.

Returns
array
toJson ( )

Cast error to JSON.

Returns
string

Member Data 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,
)
$_code = -32000
protected
$_data
protected
$_message
protected
const ERROR_INTERNAL = -32603
const ERROR_INVALID_METHOD = -32601
const ERROR_INVALID_PARAMS = -32602
const ERROR_INVALID_REQUEST = -32600
const ERROR_OTHER = -32000
const ERROR_PARSE = -32768