@@ 4-25 (lines=22) @@ | ||
1 | <?php |
|
2 | namespace Datatrics\API\Modules; |
|
3 | ||
4 | class Geo extends Base |
|
5 | { |
|
6 | /** |
|
7 | * Private constructor so only the client can create this |
|
8 | * @param string $apikey |
|
9 | */ |
|
10 | public function __construct($apikey) |
|
11 | { |
|
12 | parent::__construct($apikey, "/project/geo"); |
|
13 | } |
|
14 | ||
15 | /** |
|
16 | * Get addres based on ip addres |
|
17 | * @param string ip |
|
18 | * @return object Result of the request |
|
19 | */ |
|
20 | public function Get($ip) |
|
21 | { |
|
22 | $args = ['ip' => $ip]; |
|
23 | $this->request(self::HTTP_GET, "?".http_build_query($args)); |
|
24 | } |
|
25 | } |
|
26 |
@@ 4-25 (lines=22) @@ | ||
1 | <?php |
|
2 | namespace Datatrics\API\Modules; |
|
3 | ||
4 | class Tracker extends Base |
|
5 | { |
|
6 | /** |
|
7 | * Private constructor so only the client can create this |
|
8 | * @param string $apikey |
|
9 | * @param string $projectid |
|
10 | */ |
|
11 | public function __construct($apikey, $projectid) |
|
12 | { |
|
13 | parent::__construct($apikey, "/project/" . $projectid . "/tracker"); |
|
14 | } |
|
15 | ||
16 | /** |
|
17 | * Get the tracker stats |
|
18 | * @param object Containing query arguments |
|
19 | * @return object Result of the request |
|
20 | */ |
|
21 | public function Stats($args = array()) |
|
22 | { |
|
23 | $this->request(self::HTTP_GET, "/stats?".http_build_query($args)); |
|
24 | } |
|
25 | } |
|
26 |