PHP Class Mailjet\Response

Author: Guillaume Badi ([email protected])
ファイルを表示 Open project: mailjet/mailjet-apiv3-php Class Usage Examples

Public Methods

Method Description
__construct ( mailjet\Request $request, Psr\Http\Message\ResponseInterface $response ) Construct a Mailjet response
getBody ( ) : array Status Getter return the entire response array
getCount ( ) : null | integer Count getter return the resulting array size
getData ( ) : array Data Getter The data returned by the mailjet call
getReasonPhrase ( ) : null | string Error Reason getter return the resulting error message
getStatus ( ) : integer Status Getter return the http status code
getTotal ( ) : integer Total getter return the total count of all results
success ( ) : boolean Success getter

Protected Methods

Method Description
decodeBody ( string $body ) : object From http://stackoverflow.com/questions/19520487/json-bigint-as-string-removed-in-php-5-5

Method Details

__construct() public method

Construct a Mailjet response
public __construct ( mailjet\Request $request, Psr\Http\Message\ResponseInterface $response )
$request mailjet\Request Mailjet actual request
$response Psr\Http\Message\ResponseInterface Guzzle response

decodeBody() protected method

Decodes a mailjet string response to an object reprensenting that response
protected decodeBody ( string $body ) : object
$body string The mailjet response as string
return object Object representing the mailjet response

getBody() public method

Status Getter return the entire response array
public getBody ( ) : array
return array

getCount() public method

Count getter return the resulting array size
public getCount ( ) : null | integer
return null | integer

getData() public method

Data Getter The data returned by the mailjet call
public getData ( ) : array
return array data

getReasonPhrase() public method

Error Reason getter return the resulting error message
public getReasonPhrase ( ) : null | string
return null | string

getStatus() public method

Status Getter return the http status code
public getStatus ( ) : integer
return integer status

getTotal() public method

Total getter return the total count of all results
public getTotal ( ) : integer
return integer count

success() public method

Success getter
public success ( ) : boolean
return boolean true is return code is 2**