Maileon PHP client  1.2.5
Easily integrate your PHP application with Maileon.
com_maileon_api_MaileonAPIResult Class Reference

Public Member Functions

 __construct ($bodyData, $curlSession, $throwException=true, $deserializationType=null)
 
 getResult ()
 
 getStatusCode ()
 
 isSuccess ()
 
 isClientError ()
 
 getContentType ()
 
 getBodyData ()
 
 getResultXML ()
 
 toString ()
 

Detailed Description

The result of making a call to the Maileon REST API.

This class encapsulates the technical details of the REST API's HTTP response. In order to retrieve the payload result in deserialized form, just call com_maileon_api_MaileonAPIResult::getResult().

However, this class also allows the underlying HTTP response information to be queried, including the returned status code (com_maileon_api_MaileonAPIResult::getStatusCode()) and content type (com_maileon_api_MaileonAPIResult::getContentType()) as well as the raw HTTP response body data (com_maileon_api_MaileonAPIResult::getBodyData()).

Definition at line 15 of file MaileonAPIResult.php.

Constructor & Destructor Documentation

com_maileon_api_MaileonAPIResult::__construct (   $bodyData,
  $curlSession,
  $throwException = true,
  $deserializationType = null 
)

Creates a new result object from the curl response and session data.

Parameters
string$bodyDatathe HTTP body data, null if there was none
mixed$curlSessionthe cURL session that was used
bool$throwExceptionif true, an exception will be thrown in case of a connection or server error
mixed$deserializationTypeThe name of the class this result should be deserialized as. Use array( 'array', 'typename' ) to deserialize arrays of a type.
Exceptions
com_maileon_api_MaileonAPIExceptionif $throwException == true and there was a connection problem or a server error occurred

Definition at line 42 of file MaileonAPIResult.php.

Member Function Documentation

com_maileon_api_MaileonAPIResult::getResult ( )
Returns
mixed the deserialized result object as a subclass of com_maileon_api_xml_AbstractXMLWrapper, or the free-form string result if the response body data was not a deserializable object, or null if there was no response body data

Definition at line 102 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::getStatusCode ( )
Returns
number the HTTP status code that was returned by the HTTP request

Definition at line 110 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::isSuccess ( )
Returns
bool true iff a 2xx status code (success) was returned by the HTTP request

Definition at line 118 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::isClientError ( )
Returns
bool true iff a 4xx status code (client error) was returned by the HTTP request

Definition at line 126 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::getContentType ( )
Returns
string the content type returned by the HTTP request

Definition at line 134 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::getBodyData ( )
Returns
string the unprocessed HTTP body data, or null if there was no body

Definition at line 142 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::getResultXML ( )
Returns
SimpleXMLElement the HTTP body data parsed as a SimpleXMLElement, or null if there was no XML in the body

Definition at line 150 of file MaileonAPIResult.php.

com_maileon_api_MaileonAPIResult::toString ( )
Returns
string a human-readable representation of the HTTP request result

Definition at line 158 of file MaileonAPIResult.php.


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