Json/Server/Error.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Json  
Version
$Id$  

\Zend_Json_Server_Error

Package: Zend_Json
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

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

Properties

>VPropertyprotectedarray $_allowedCodes = array(self::ERROR_PARSE, self::ERROR_INVALID_REQUEST, self::ERROR_INVALID_METHOD, self::ERROR_INVALID_PARAMS, self::ERROR_INTERNAL, self::ERROR_OTHER)
Allowed error codes
Default valuearray(self::ERROR_PARSE, self::ERROR_INVALID_REQUEST, self::ERROR_INVALID_METHOD, self::ERROR_INVALID_PARAMS, self::ERROR_INTERNAL, self::ERROR_OTHER)Details
Type
array
>VPropertyprotectedint $_code = -32000
Current code
Default value-32000Details
Type
int
>VPropertyprotectedmixed $_data
Error data
Details
Type
mixed
>VPropertyprotectedstring $_message
Error message
Details
Type
string

Methods

methodpublic__construct(string $message = null, int $code = -32000, mixed $data = null) : void

Constructor

Parameters
NameTypeDescription
$messagestring
$codeint
$datamixed
methodpublic__toString() : string

Cast to string (JSON)

Returns
TypeDescription
string
methodpublicgetCode() : int | null

Get error code

Returns
TypeDescription
int | null
methodpublicgetData() : mixed

Get error data

Returns
TypeDescription
mixed
methodpublicgetMessage() : string

Get error message

Returns
TypeDescription
string
methodpublicsetCode(int $code) : \Zend_Json_Server_Error

Set error code

Parameters
NameTypeDescription
$codeint
Returns
TypeDescription
\Zend_Json_Server_Error
methodpublicsetData(mixed $data) : \Zend_Json_Server_Error

Set error data

Parameters
NameTypeDescription
$datamixed
Returns
TypeDescription
\Zend_Json_Server_Error
methodpublicsetMessage(string $message) : \Zend_Json_Server_Error

Set error message

Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_Json_Server_Error
methodpublictoArray() : array

Cast error to array

Returns
TypeDescription
array
methodpublictoJson() : string

Cast error to JSON

Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .