Fixed an issue with HTTPBroker, Lists, Routes and Stats

This commit is contained in:
Travis Swientek 2013-08-02 16:32:22 -07:00
parent f3c7fb51d9
commit 854711656c
4 changed files with 6 additions and 6 deletions

View File

@ -51,8 +51,8 @@ class HttpBroker{
public function getRequest($endpointUrl, $queryString = array()){ public function getRequest($endpointUrl, $queryString = array()){
$request = $this->mgClient->get($endpointUrl); $request = $this->mgClient->get($endpointUrl);
foreach($queryString as $queryKey=>$queryValue){ foreach($queryString as $key=>$value){
$request->getQuery()->set($queryKey, $queryValue); $request->getQuery()->set($key, $value);
} }
$response = $request->send(); $response = $request->send();
return $this->responseHandler($response); return $this->responseHandler($response);

View File

@ -14,7 +14,7 @@ class Lists{
public function __construct($httpBroker){ public function __construct($httpBroker){
$this->httpBroker = $httpBroker; $this->httpBroker = $httpBroker;
$this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/lists"; $this->endpointUrl = "lists";
} }

View File

@ -15,7 +15,7 @@ class Routes{
public function __construct($httpBroker){ public function __construct($httpBroker){
$this->httpBroker = $httpBroker; $this->httpBroker = $httpBroker;
$this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/routes"; $this->endpointUrl = "routes";
} }
public function getRoutes($limit, $skip){ public function getRoutes($limit, $skip){

View File

@ -25,8 +25,8 @@ class Stats{
return $response; return $response;
} }
public function getStats($limit, $skip){ public function getStats($filterParams = array()){
$response = $this->httpBroker->getRequest($this->statsEndpointUrl, array($limit, $skip, $event, $start-date)); $response = $this->httpBroker->getRequest($this->statsEndpointUrl, $filterParams);
return $response; return $response;
} }
} }