| Conditions | 3 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function fetchDashboard($zone = '', $options = []) |
||
| 20 | { |
||
| 21 | $defaultOptions = [ |
||
| 22 | 'since' => '-10080', |
||
| 23 | 'until' => 0, |
||
| 24 | 'continuous' => "true", |
||
| 25 | ]; |
||
| 26 | |||
| 27 | $newOptions = []; |
||
| 28 | $newOptions = array_merge($newOptions, $defaultOptions, $options); |
||
| 29 | |||
| 30 | $string = "?"; |
||
| 31 | foreach ($newOptions as $k => $v) { |
||
| 32 | $string .= $k . '=' . $v . '&'; |
||
| 33 | } |
||
| 34 | |||
| 35 | //Remove the last '&' |
||
| 36 | $string = substr($string, 0, -1); |
||
| 37 | |||
| 38 | try{ |
||
| 39 | $this->makeRequest($this->URL . '/' . $zone . '/analytics/dashboard/' . $string); |
||
| 40 | } catch (ClientException $e) { |
||
| 41 | return false; |
||
| 42 | } |
||
| 43 | |||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 53 |