Skip to content

Commit 50c7012

Browse files
committed
Makes BC change to allow calls to request method
1 parent 60a7d48 commit 50c7012

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/MailchimpApiUser.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MailchimpApiUser {
1717
*
1818
* @var MailchimpApiInterface $apiClass
1919
*/
20-
public $api_class;
20+
protected $api_class;
2121

2222
/**
2323
* Mailchimp API user constructor.
@@ -130,4 +130,30 @@ public function hasApiAccess() {
130130
}
131131
}
132132

133+
/**
134+
* Passes on request to Mailchimp Api Interface.
135+
* This allows backwards compatibilty with existing calls.
136+
*
137+
* @param string $method
138+
* The REST method to use when making the request.
139+
* @param string $path
140+
* The API path to request.
141+
* @param array $tokens
142+
* Associative array of tokens and values to replace in the path.
143+
* @param array $parameters
144+
* Associative array of parameters to send in the request body.
145+
* @param bool $batch
146+
* TRUE if this request should be added to pending batch operations.
147+
* @param bool $returnAssoc
148+
* TRUE to return Mailchimp API response as an associative array.
149+
*
150+
* @return mixed
151+
* Object or Array if $returnAssoc is TRUE.
152+
*
153+
* @throws MailchimpAPIException
154+
*/
155+
public function request($method, $path, $tokens = NULL, $parameters = [], $batch = FALSE, $returnAssoc = FALSE) {
156+
return $this->api_class->request($method, $path, $tokens = NULL, $parameters = [], $batch = FALSE, $returnAssoc = FALSE);
157+
}
158+
133159
}

0 commit comments

Comments
 (0)