summaryrefslogtreecommitdiffstats
path: root/lib/resources/global_stats.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/resources/global_stats.php')
-rw-r--r--lib/resources/global_stats.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/resources/global_stats.php b/lib/resources/global_stats.php
new file mode 100644
index 0000000..b139767
--- /dev/null
+++ b/lib/resources/global_stats.php
@@ -0,0 +1,40 @@
+<?php
+
+class GlobalStats
+{
+ protected
+ $base_endpoint,
+ $endpoint,
+ $client;
+
+ public function __construct($client, $options=NULL)
+ {
+ $this->name = NULL;
+ $this->base_endpoint = "/v3/stats";
+ $this->endpoint = "/v3/stats";
+ $this->client = $client;
+ }
+
+ public function getBaseEndpoint(){
+ return $this->base_endpoint;
+ }
+
+ public function getEndpoint(){
+ return $this->endpoint;
+ }
+
+ public function setEndpoint($endpoint){
+ $this->endpoint = $endpoint;
+ }
+
+ public function get($start_date, $end_date=Null, $aggregated_by=Null){
+ $this->endpoint = $this->base_endpoint . "?start_date=" . $start_date;
+ if($end_date != Null){
+ $this->endpoint = $this->endpoint . "&end_date=" . $end_date;
+ }
+ if($aggregated_by != Null){
+ $this->endpoint = $this->endpoint . "&aggregated_by=" . $aggregated_by;
+ }
+ return $this->client->getRequest($this);
+ }
+} \ No newline at end of file