File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,17 +107,31 @@ public function __construct($orgId = NULL, $portalId = NULL) {
107107 * @package SalesforceSoapClient
108108 */
109109class QueryOptions {
110- // 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.
110+ /** @var int */
111111 public $ batchSize ;
112112
113113 /**
114- * Constructor
115- *
116114 * @param int $limit Batch size
117115 */
118- public function __construct ($ limit ) {
116+ public function __construct ($ limit = 500 ) {
117+ $ this ->validateLimit ($ limit );
119118 $ this ->batchSize = $ limit ;
120119 }
120+
121+ /**
122+ * @param int $limit
123+ *
124+ * @throws Exception
125+ */
126+ private function validateLimit ($ limit )
127+ {
128+ if ($ limit < 200 ) {
129+ throw new \Exception ('The batch size limit can \'t be lower than 200 ' );
130+ }
131+ if ($ limit > 2000 ) {
132+ throw new \Exception ('The batch size limit can \'t be higher than 2000 ' );
133+ }
134+ }
121135}
122136
123137class EmailHeader {
You can’t perform that action at this time.
0 commit comments