File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ class CRM_Utils_REST {
36
36
const LAST_HIT = 'rest_lasthit ' ;
37
37
const RATE_LIMIT = 0.2 ;
38
38
39
+ /**
40
+ * Response row limit per request
41
+ */
42
+ static $ limitRows = 100 ;
43
+
39
44
/**
40
45
* Number of seconds we should let a REST process idle
41
46
* @static
@@ -395,8 +400,11 @@ static function process(&$args, $params = array()) {
395
400
if (isset ($ options ['limit ' ]) && !CRM_Utils_Rule::integer ($ options ['limit ' ])) {
396
401
return self ::error ('limit in options should be integer. ' );
397
402
}
398
- if (isset ($ options ['limit ' ]) && $ options ['limit ' ] > 100 ) {
399
- return self ::error ('limit in options can \'t not larger than 100. ' );
403
+ if (defined ('CIVICRM_REST_LIMIT_ROWS ' ) && CRM_Utils_Rule::positiveInteger (CIVICRM_REST_LIMIT_ROWS ) && CIVICRM_REST_LIMIT_ROWS > self ::$ limitRows ) {
404
+ self ::$ limitRows = CIVICRM_REST_LIMIT_ROWS ;
405
+ }
406
+ if (isset ($ options ['limit ' ]) && $ options ['limit ' ] > self ::$ limitRows ) {
407
+ return self ::error ('limit in options can \'t not larger than ' .self ::$ limitRows .'. ' );
400
408
}
401
409
if (isset ($ options ['offset ' ]) && !CRM_Utils_Rule::integer ($ options ['offset ' ])) {
402
410
return self ::error ('offset in options should be integer. ' );
You can’t perform that action at this time.
0 commit comments