PHP Class RESTfulAPI_Error

Author: Thierry Francois @colymba [email protected]
Afficher le fichier Open project: colymba/silverstripe-restfulapi Class Usage Examples

Méthodes publiques

Свойство Type Description
$body mixed Error response body to be serialized
$code integer Error HTTP status code
$message string Error message

Méthodes publiques

Méthode Description
__construct ( integer $code, string $message, $body = null ) Creates the error object and sets properties
get_json_error ( ) : false | string Check for the latest JSON parsing error and return the message if any

Method Details

__construct() public méthode

Creates the error object and sets properties
public __construct ( integer $code, string $message, $body = null )
$code integer HTTP status code
$message string Error message

get_json_error() public static méthode

More available for PHP >= 5.3.3 http://www.php.net/manual/en/function.json-last-error.php
public static get_json_error ( ) : false | string
Résultat false | string Returns false if no error or a string with the error detail.

Property Details

$body public_oe property

Error response body to be serialized
public mixed $body
Résultat mixed

$code public_oe property

Error HTTP status code
public int $code
Résultat integer

$message public_oe property

Error message
public string $message
Résultat string