|
|
@ -55,7 +55,10 @@ class WfdAPI extends API { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getStationSamples($station_id) { |
|
|
|
public function getStationSamples($station_id) { |
|
|
|
$endpoint = "/coastal-trans-samples"; |
|
|
|
$endpoint = "coastal-trans-samples"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->headers["Authorization"] = "Bearer {$this->accessToken}"; |
|
|
|
|
|
|
|
$this->headers["Accept"] = "application/json"; |
|
|
|
$data = array( |
|
|
|
$data = array( |
|
|
|
"coastalTransStationId.equals" => $station_id |
|
|
|
"coastalTransStationId.equals" => $station_id |
|
|
|
); |
|
|
|
); |
|
|
@ -68,13 +71,21 @@ class WfdAPI extends API { |
|
|
|
* Fetches data for a specific station according to the sample sampleIds |
|
|
|
* Fetches data for a specific station according to the sample sampleIds |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getData($parameter_ids) { |
|
|
|
public function getData($parameter_ids, $data_category='all') { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->headers["Authorization"] = "Bearer {$this->accessToken}"; |
|
|
|
|
|
|
|
$this->headers["Accept"] = "application/json"; |
|
|
|
|
|
|
|
$res = []; |
|
|
|
$data = array( |
|
|
|
$data = array( |
|
|
|
"coastalTransSampleId.in" => implode(",", $parameter_ids) |
|
|
|
"coastalTransSampleId.in" => implode(",", $parameter_ids) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$endpoint = "coastal-trans-abiotics"; |
|
|
|
if ($data_category === 'all') |
|
|
|
$res = json_decode($this->get($endpoint, $data)); |
|
|
|
$endpoints = array("coastal-trans-abiotics","coastal-trans-macrofaunas", "coastal-trans-phytoplanktons", "coastal-trans-angiosperms"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($endpoints as $endpoint) { |
|
|
|
|
|
|
|
array_push($res, json_decode($this->get($endpoint, $data))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $res; |
|
|
|
return $res; |
|
|
|
} |
|
|
|
} |
|
|
|