PHP Class DrewM\MailChimp\Batch

http://developer.mailchimp.com/documentation/mailchimp/reference/batches/
Author: Drew McLellan ([email protected])
Mostrar archivo Open project: drewm/mailchimp-api

Public Methods

Method Description
__construct ( MailChimp $MailChimp, $batch_id = null )
check_status ( string $batch_id = null ) : array | false Check the status of a batch request. If the current instance of the Batch object was used to make the request, the batch_id is already known and is therefore optional.
delete ( string $id, string $method ) : void Add an HTTP DELETE request operation to the batch - for deleting data
execute ( integer $timeout = 10 ) : array | false Execute the batch request
get ( string $id, string $method, array $args = [] ) : void Add an HTTP GET request operation to the batch - for retrieving data
patch ( string $id, string $method, array $args = [] ) : void Add an HTTP PATCH request operation to the batch - for performing partial updates
post ( string $id, string $method, array $args = [] ) : void Add an HTTP POST request operation to the batch - for creating and updating items
put ( string $id, string $method, array $args = [] ) : void Add an HTTP PUT request operation to the batch - for creating new items

Private Methods

Method Description
queueOperation ( string $http_verb, string $id, string $method, array $args = null ) : void Add an operation to the internal queue.

Method Details

__construct() public method

public __construct ( MailChimp $MailChimp, $batch_id = null )
$MailChimp MailChimp

check_status() public method

Check the status of a batch request. If the current instance of the Batch object was used to make the request, the batch_id is already known and is therefore optional.
public check_status ( string $batch_id = null ) : array | false
$batch_id string ID of the batch about which to enquire
return array | false Assoc array of API response, decoded from JSON

delete() public method

Add an HTTP DELETE request operation to the batch - for deleting data
public delete ( string $id, string $method ) : void
$id string ID for the operation within the batch
$method string URL of the API request method
return void

execute() public method

Execute the batch request
public execute ( integer $timeout = 10 ) : array | false
$timeout integer Request timeout in seconds (optional)
return array | false Assoc array of API response, decoded from JSON

get() public method

Add an HTTP GET request operation to the batch - for retrieving data
public get ( string $id, string $method, array $args = [] ) : void
$id string ID for the operation within the batch
$method string URL of the API request method
$args array Assoc array of arguments (usually your data)
return void

patch() public method

Add an HTTP PATCH request operation to the batch - for performing partial updates
public patch ( string $id, string $method, array $args = [] ) : void
$id string ID for the operation within the batch
$method string URL of the API request method
$args array Assoc array of arguments (usually your data)
return void

post() public method

Add an HTTP POST request operation to the batch - for creating and updating items
public post ( string $id, string $method, array $args = [] ) : void
$id string ID for the operation within the batch
$method string URL of the API request method
$args array Assoc array of arguments (usually your data)
return void

put() public method

Add an HTTP PUT request operation to the batch - for creating new items
public put ( string $id, string $method, array $args = [] ) : void
$id string ID for the operation within the batch
$method string URL of the API request method
$args array Assoc array of arguments (usually your data)
return void