Maileon PHP client  1.2.5
Easily integrate your PHP application with Maileon.
com_maileon_api_AbstractMaileonService Class Reference
Inheritance diagram for com_maileon_api_AbstractMaileonService:
com_maileon_api_blacklists_BlacklistsService com_maileon_api_contactfilters_ContactfiltersService com_maileon_api_contacts_ContactsService com_maileon_api_mailings_MailingsService com_maileon_api_marketingautomation_MarketingAutomationService com_maileon_api_reports_ReportsService com_maileon_api_targetgroups_TargetGroupsService com_maileon_api_transactions_TransactionsService com_maileon_api_utils_PingService

Public Member Functions

 __construct (array $config)
 
 setDebug ($isDebug)
 
 isDebug ()
 
 get ($resourcePath, $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null)
 
 put ($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null)
 
 post ($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null)
 
 delete ($resourcePath, $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null)
 

Static Public Attributes

static $MAILEON_XML_MIME_TYPE = 'application/vnd.maileon.api+xml'
 

Protected Member Functions

 appendArrayFields ($params, $name, $fieldValues)
 

Protected Attributes

 $configuration
 
 $encodedApiKey
 
 $debug = false
 
 $throwException = true
 
 $proxy_host
 
 $proxy_port = 80
 
 $timeout
 

Detailed Description

Abstract base class for all the service accessing individual resources. This class handles the basic authentication and provides convenience methods to access the four HTTP methods used in RESTful web services.

Author
Felix Heinrichs | Trusted Mails GmbH | felix.heinrichs@trusted-mails.com
Marcus Ständer | Trusted Mails GmbH | marcus.staender@trusted-mails.com

Definition at line 11 of file AbstractMaileonService.php.

Constructor & Destructor Documentation

com_maileon_api_AbstractMaileonService::__construct ( array  $config)

Creates a new instance of the service.

Parameters
string[]$config the API call configuration array

Definition at line 78 of file AbstractMaileonService.php.

Member Function Documentation

com_maileon_api_AbstractMaileonService::setDebug (   $isDebug)

(De)activates printing debug output. CAUTION: enabling this in production may compromise sensitive information.

Parameters
bool$isDebugtrue to enable debugging, false to disable it

Definition at line 114 of file AbstractMaileonService.php.

com_maileon_api_AbstractMaileonService::isDebug ( )
Parameters
unknown$isDebug
Returns
boolean true if debug output is enabled, false otherwise

Definition at line 124 of file AbstractMaileonService.php.

com_maileon_api_AbstractMaileonService::get (   $resourcePath,
  $queryParameters = array(),
  $mimeType = 'application/vnd.maileon.api+xml',
  $deserializationType = null 
)

Performs a GET operation on a resource

Parameters
string$resourcePaththe path of the resource to GET
string[]$queryParameters any additional query parameters
string$mimeTypethe acceptable response MIME type
mixed$deserializationTypeThe name of the class this result should be deserialized as. Use array( 'array', 'typename' ) to deserialize arrays of a type.
Returns
com_maileon_api_MaileonAPIResult the result object of the API call
Exceptions
com_maileon_api_MaileonAPIExceptionif there was a connection problem or a server error occurred

Definition at line 146 of file AbstractMaileonService.php.

com_maileon_api_AbstractMaileonService::put (   $resourcePath,
  $payload = "",
  $queryParameters = array(),
  $mimeType = 'application/vnd.maileon.api+xml',
  $deserializationType = null 
)

Performs a PUT operation (i.e. an update) on a resource.

Parameters
string$resourcePaththe path of the resource to PUT
string$payloadthe payload data to PUT, i.e. the data to update the current state of the resource with
array$queryParametersany additional query parameters
string$mimeTypethe acceptable response MIME type
mixed$deserializationTypeThe name of the class this result should be deserialized as. Use array( 'array', 'typename' ) to deserialize arrays of a type.
Returns
com_maileon_api_MaileonAPIResult the result object of the API call
Exceptions
com_maileon_api_MaileonAPIExceptionif there was a connection problem or a server error occurred

Definition at line 173 of file AbstractMaileonService.php.

com_maileon_api_AbstractMaileonService::post (   $resourcePath,
  $payload = "",
  $queryParameters = array(),
  $mimeType = 'application/vnd.maileon.api+xml',
  $deserializationType = null 
)

Performs a POST operation (i.e. creates a new instance) on a resource.

Parameters
string$resourcePaththe path of the resource to POST. This is typically the parent (or owner) resource of the resource instance to create.
string$payloadthe data to POST, i.e. the contents of the new resource instance
array$queryParametersany additional query parameters
string$mimeTypethe acceptable response MIME type
mixed$deserializationTypeThe name of the class this result should be deserialized as. Use array( 'array', 'typename' ) to deserialize arrays of a type.
Returns
com_maileon_api_MaileonAPIResult the result object of the API call
Exceptions
com_maileon_api_MaileonAPIExceptionif there was a connection problem or a server error occurred

Definition at line 208 of file AbstractMaileonService.php.

com_maileon_api_AbstractMaileonService::delete (   $resourcePath,
  $queryParameters = array(),
  $mimeType = 'application/vnd.maileon.api+xml',
  $deserializationType = null 
)

Performs a DELETE operation on a resource.

Parameters
string$resourcePaththe resource to DELETE
array$queryParametersany additional query parameters
string$mimeTypethe acceptable response MIME type
mixed$deserializationTypeThe name of the class this result should be deserialized as. Use array( 'array', 'typename' ) to deserialize arrays of a type.
Returns
com_maileon_api_MaileonAPIResult the result object of the API call
Exceptions
com_maileon_api_MaileonAPIExceptionif there was a connection problem or a server error occurred

Definition at line 235 of file AbstractMaileonService.php.

Member Data Documentation

string com_maileon_api_AbstractMaileonService::$MAILEON_XML_MIME_TYPE = 'application/vnd.maileon.api+xml'
static

Mime type for the maileon xml data format.

Definition at line 19 of file AbstractMaileonService.php.

array com_maileon_api_AbstractMaileonService::$configuration
protected

Configuration object storing BASE_URI and API_KEY to access the maileon REST API.

Definition at line 26 of file AbstractMaileonService.php.

string com_maileon_api_AbstractMaileonService::$encodedApiKey
protected

Base64 encoded version of the API key.

Definition at line 33 of file AbstractMaileonService.php.

boolean com_maileon_api_AbstractMaileonService::$debug = false
protected

If true, print debug output (e.g. sent header will be printed)

Definition at line 40 of file AbstractMaileonService.php.

boolean com_maileon_api_AbstractMaileonService::$throwException = true
protected

If true, throw an exception if a transmission or server error occures

Definition at line 47 of file AbstractMaileonService.php.

string com_maileon_api_AbstractMaileonService::$proxy_host
protected

If a proxy is used, provide the proxy IP here

Definition at line 54 of file AbstractMaileonService.php.

int com_maileon_api_AbstractMaileonService::$proxy_port = 80
protected

If a proxy is used, use this port. Default is 80.

Definition at line 61 of file AbstractMaileonService.php.

int com_maileon_api_AbstractMaileonService::$timeout
protected

If set, this sets the timeout for a CURL request

Definition at line 68 of file AbstractMaileonService.php.


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