Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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()`

Expand Down
7 changes: 6 additions & 1 deletion src/dawguk/GarminConnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down