Skip to content

Commit

Permalink
Updated filter
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfensdrfer committed Apr 11, 2019
1 parent a656be5 commit 6c7bb25
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Matomo.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ class Matomo

private $_period = self::PERIOD_DAY;
private $_date = '';
/**
* @var int Defines the number of rows to be returned (-1: All rows).
*/
private $_filter_limit = 100;
private $_rangeStart = 'yesterday';
private $_rangeEnd = null;
private $_isJsonDecodeAssoc = false;

private $_limit = -1;
/**
private $_errors = [];
Expand Down Expand Up @@ -307,24 +311,24 @@ public function setRange($rangeStart, $rangeEnd = null)
}

/**
* Get the limit of returned rows
* Get the number rows which should be returned
*
* @return int
*/
public function getLimit()
public function getFilterLimit(): int
{
return intval($this->_limit);
return $this->_filter_limit;
}

/**
* Set the limit of returned rows
* Set the number of rows which should be returned
*
* @param int $limit
* @param int $filterLimit
* @return $this
*/
public function setLimit($limit)
public function setFilterLimit(int $filterLimit): Matomo
{
$this->_limit = $limit;
$this->_filter_limit = $filterLimit;

return $this;
}
Expand Down Expand Up @@ -445,8 +449,8 @@ private function _parseUrl($method, array $params = [])
'period' => $this->_period,
'format' => $this->_format,
'language' => $this->_language,
'filter_limit' => $this->_filter
] + $params;
'filter_limit' => $this->_filter_limit
] + $params;

foreach ($params as $key => $value) {
$params[$key] = urlencode($value);
Expand Down

0 comments on commit 6c7bb25

Please sign in to comment.