diff --git a/README.md b/README.md index 52817ab..a0e0f98 100755 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The library implements a few basic API functions that you can use to retrieve us | Method | Parameters | Returns | | ----------------------- | -------------------- | --------------------------- | | getActivityTypes() | - | Array | -| getActivityList() | integer $intStart, integer $intLimit, string $strActivityType | stdClass | +| getActivityList() | integer $intStart, integer $intLimit, string $strActivityType, array $filters | stdClass | | getActivitySummary() | integer $intActivityID | stdClass | | getActivityDetails() | integer $intActivityID | stdClass | | getDataFile | string $strType, integer $intActivityID | string | @@ -105,7 +105,7 @@ try { ) -### getActivityList(integer $intStart, integer $intLimit, string $strActivityType) +### getActivityList(integer $intStart, integer $intLimit, string $strActivityType, array $filters) Returns a stdClass object, which contains an array called results, that contains stdClass objects that represents an activity. It accepts three parameters - start, limit and activity type; start is the record that you wish to start from, limit is the number of records that you would like returned, and activity type is the (optional) string representation of the activity type returned from `getActivityTypes()` diff --git a/src/dawguk/GarminConnect.php b/src/dawguk/GarminConnect.php index ca01721..680b03f 100755 --- a/src/dawguk/GarminConnect.php +++ b/src/dawguk/GarminConnect.php @@ -205,10 +205,11 @@ public function getActivityTypes() * @param integer $intStart * @param integer $intLimit * @param null $strActivityType + * @param array $filters * @return mixed * @throws UnexpectedResponseCodeException */ - public function getActivityList($intStart = 0, $intLimit = 10, $strActivityType = null) + public function getActivityList($intStart = 0, $intLimit = 10, $strActivityType = null, $filters = array()) { $arrParams = array( 'start' => $intStart, @@ -219,6 +220,10 @@ public function getActivityList($intStart = 0, $intLimit = 10, $strActivityType $arrParams['activityType'] = $strActivityType; } + if (!empty($filters)) { + $arrParams = array_merge($arrParams, $filters); + } + $strResponse = $this->objConnector->get( 'https://connect.garmin.com/modern/proxy/activitylist-service/activities/search/activities', $arrParams,