-
Notifications
You must be signed in to change notification settings - Fork 9
/
AchievementEndpoint.php
51 lines (43 loc) · 1.35 KB
/
AchievementEndpoint.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace GW2Treasures\GW2Api\V2\Endpoint\Account;
use Exception;
use GW2Treasures\GW2Api\GW2Api;
use GW2Treasures\GW2Api\V2\Authentication\AuthenticatedEndpoint;
use GW2Treasures\GW2Api\V2\Authentication\IAuthenticatedEndpoint;
use GW2Treasures\GW2Api\V2\Bulk\BulkEndpoint;
use GW2Treasures\GW2Api\V2\Bulk\IBulkEndpoint;
use GW2Treasures\GW2Api\V2\Endpoint;
use GW2Treasures\GW2Api\V2\Pagination\IPaginatedEndpoint;
class AchievementEndpoint extends Endpoint implements IAuthenticatedEndpoint, IPaginatedEndpoint, IBulkEndpoint {
use AuthenticatedEndpoint, BulkEndpoint {
BulkEndpoint::get as private bulkGet;
BulkEndpoint::ids as private bulkIds;
}
public function __construct( GW2Api $api, $apiKey ) {
parent::__construct( $api );
$this->apiKey = $apiKey;
}
/**
* {@inheritdoc}
*/
public function url() {
return 'v2/account/achievements';
}
public function get($id = null) {
if($id == null) {
return $this->all();
} else {
return $this->bulkGet($id);
}
}
/**
* This endpoint doesn't support ids()!
*
* @deprecated This endpoint doesn't support ids()!
* @throws Exception
* @return void
*/
public function ids() {
throw new Exception($this->url()." doesn't support ids().");
}
}