-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add /v2/pvp/seasons/:id/leaderboards/:board/:region
- Loading branch information
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace GW2Treasures\GW2Api\V2\Endpoint\Pvp; | ||
|
||
use GW2Treasures\GW2Api\GW2Api; | ||
use GW2Treasures\GW2Api\V2\Endpoint; | ||
|
||
class LeaderboardEndpoint extends Endpoint { | ||
/** @var string $season */ | ||
private $season; | ||
|
||
/** | ||
* @param GW2Api $api | ||
* @param string $season | ||
*/ | ||
public function __construct(GW2Api $api, $season) { | ||
parent::__construct($api); | ||
$this->season = $season; | ||
} | ||
|
||
/** | ||
* The url of this endpoint. | ||
* | ||
* @return string | ||
*/ | ||
public function url() { | ||
return 'v2/pvp/seasons/'.$this->season.'/leaderboards'; | ||
} | ||
|
||
/** | ||
* Get a list of available leaderboards. | ||
* | ||
* @return string[] | ||
*/ | ||
public function ids() { | ||
return $this->request()->json(); | ||
} | ||
|
||
public function get($leaderboard, $region) { | ||
return new LeaderboardRegionEndpoint($this->api, $this->season, $leaderboard, $region); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace GW2Treasures\GW2Api\V2\Endpoint\Pvp; | ||
|
||
use GW2Treasures\GW2Api\GW2Api; | ||
use GW2Treasures\GW2Api\V2\Endpoint; | ||
use GW2Treasures\GW2Api\V2\Pagination\IPaginatedEndpoint; | ||
use GW2Treasures\GW2Api\V2\Pagination\PaginatedEndpoint; | ||
|
||
class LeaderboardRegionEndpoint extends Endpoint implements IPaginatedEndpoint { | ||
use PaginatedEndpoint; | ||
|
||
/** @var string $season */ | ||
private $season; | ||
|
||
/** @var string $leaderboard */ | ||
private $leaderboard; | ||
|
||
/** @var string $region */ | ||
private $region; | ||
|
||
/** | ||
* @param GW2Api $api | ||
* @param string $season | ||
* @param string $leaderboard | ||
* @param string $region | ||
*/ | ||
public function __construct(GW2Api $api, $season, $leaderboard, $region) { | ||
parent::__construct($api); | ||
|
||
$this->season = $season; | ||
$this->leaderboard = $leaderboard; | ||
$this->region = $region; | ||
} | ||
|
||
|
||
/** | ||
* The url of this endpoint. | ||
* | ||
* @return string | ||
*/ | ||
public function url() { | ||
return 'v2/pvp/seasons/'.$this->season.'/leaderboards/'.$this->leaderboard.'/'.$this->region; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters