-
Notifications
You must be signed in to change notification settings - Fork 7
Time Series Gateways #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for submitting this. I'll take a closer look at it this weekend. |
|
I've been thinking for a while that the time series functionality would be better suited as part of the existing gateways instead of in separate gateways. For example, instead of Something like this: $activities = $factory->getActivityGateway();
$activities->getTimeSeries('distance', 'today', '7d');
public function getTimeSeries($type, $base_date = null, $end_date = null)
{
$url = '/activities/log/' . $type;
return $this->makeTimeSeriesApiRequest($url, $base_date, $end_date);
}What do you think? I'd also get rid of the magic methods, favoring explicitly defined methods like this instead: $activities->getMinutesVeryActive();
public function getMinutesVeryActive($base_date = null, $end_date = null)
{
return $this->getTimeSeries('minutesVeryActive', $base_date, $end_date);
}
public function getTrackerCalories($base_date = null, $end_date = null)
{
return $this->getTimeSeries('tracker/calories', $base_date, $end_date);
} |
Hi, I created a set of Time Series Gateways for your repo, take a look and let me know if u wanna merge.