twingle api batch size as parameter

This commit is contained in:
Marc Michalsky forumZFD 2020-11-12 13:52:14 +01:00
parent 79933f23be
commit 38d4db8a3f
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 16 additions and 3 deletions

View file

@ -26,11 +26,15 @@ class TwingleApiCall {
*
* @param $apiKey
*
* @param int $limit
* Limit for the number of events that should get requested per call to the
* Twingle API
*
* @throws API_Exception
*/
public function __construct($apiKey) {
public function __construct($apiKey, int $limit = 20) {
$this->apiKey = $apiKey;
$this->limit = CRM_Core_BAO_Setting::getItem('', 'twingle_request_size');
$this->limit = $limit;
// Get organisation id
$curl = curl_init($this->protocol . 'organisation' . $this->baseUrl);