@@ -37,11 +37,15 @@ class Matomo
3737
3838 private $ _period = self ::PERIOD_DAY ;
3939 private $ _date = '' ;
40+ /**
41+ * @var int Defines the number of rows to be returned (-1: All rows).
42+ */
43+ private $ _filter_limit = 100 ;
4044 private $ _rangeStart = 'yesterday ' ;
4145 private $ _rangeEnd = null ;
4246 private $ _isJsonDecodeAssoc = false ;
4347
44- private $ _limit = - 1 ;
48+ /**
4549
4650 private $_errors = [];
4751
@@ -307,24 +311,24 @@ public function setRange($rangeStart, $rangeEnd = null)
307311 }
308312
309313 /**
310- * Get the limit of returned rows
314+ * Get the number rows which should be returned
311315 *
312316 * @return int
313317 */
314- public function getLimit ()
318+ public function getFilterLimit (): int
315319 {
316- return intval ( $ this ->_limit ) ;
320+ return $ this ->_filter_limit ;
317321 }
318322
319323 /**
320- * Set the limit of returned rows
324+ * Set the number of rows which should be returned
321325 *
322- * @param int $limit
326+ * @param int $filterLimit
323327 * @return $this
324328 */
325- public function setLimit ( $ limit )
329+ public function setFilterLimit ( int $ filterLimit ): Matomo
326330 {
327- $ this ->_limit = $ limit ;
331+ $ this ->_filter_limit = $ filterLimit ;
328332
329333 return $ this ;
330334 }
@@ -445,8 +449,8 @@ private function _parseUrl($method, array $params = [])
445449 'period ' => $ this ->_period ,
446450 'format ' => $ this ->_format ,
447451 'language ' => $ this ->_language ,
448- 'filter_limit ' => $ this ->_filter
449- ] + $ params ;
452+ 'filter_limit ' => $ this ->_filter_limit
453+ ] + $ params ;
450454
451455 foreach ($ params as $ key => $ value ) {
452456 $ params [$ key ] = urlencode ($ value );
0 commit comments