Skip to content

Commit 0616e3a

Browse files
authored
Merge pull request #113 from thinkshout/public-request
Allows requests from API user objects
2 parents 250e74a + 50c7012 commit 0616e3a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/MailchimpApiUser.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)