DrewM\MailChimp\Batch::queueOperation PHP Method

queueOperation() private method

Add an operation to the internal queue.
private queueOperation ( string $http_verb, string $id, string $method, array $args = null ) : void
$http_verb string GET, POST, PUT, PATCH or DELETE
$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
    private function queueOperation($http_verb, $id, $method, $args = null)
    {
        $operation = array('operation_id' => $id, 'method' => $http_verb, 'path' => $method);
        if ($args) {
            $key = $http_verb == 'GET' ? 'params' : 'body';
            $operation[$key] = json_encode($args);
        }
        $this->operations[] = $operation;
    }