Skip to content

Commit

Permalink
Merge Update SforceHeaderOptions.php from developerforce#57
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbauman committed Dec 10, 2018
1 parent 221a7a8 commit 33239e1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions soapclient/SforceHeaderOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,31 @@ public function __construct($orgId = NULL, $portalId = NULL) {
* @package SalesforceSoapClient
*/
class QueryOptions {
// int - Batch size for the number of records returned in a query or queryMore call. The default is 500; the minimum is 200, and the maximum is 2,000.
/** @var int */
public $batchSize;

/**
* Constructor
*
* @param int $limit Batch size
*/
public function __construct($limit) {
public function __construct($limit = 500) {
$this->validateLimit($limit);
$this->batchSize = $limit;
}

/**
* @param int $limit
*
* @throws Exception
*/
private function validateLimit($limit)
{
if ($limit < 200) {
throw new \Exception('The batch size limit can\'t be lower than 200');
}
if ($limit > 2000) {
throw new \Exception('The batch size limit can\'t be higher than 2000');
}
}
}

class EmailHeader {
Expand Down

0 comments on commit 33239e1

Please sign in to comment.