Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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