function __construct($params) { if (!isset($params['questId'])) { throw new BattleNetAPI_Exception('The "/wow/quest/" endpoint requires the parameter "questId".'); } $this->url = BattleNetAPI::getHost() . '/wow/quest/' . $params['questId']; }
function __construct($params) { if (!isset($params['realm'])) { throw new BattleNetAPI_Exception('The "/wow/auction/data/" endpoint requires the parameter "realm".'); } $this->url = BattleNetAPI::getHost() . '/wow/auction/data/' . rawurlencode($params['realm']); }
function __construct($params) { if (isset($params['zoneId'])) { $this->url = BattleNetAPI::getHost() . '/wow/zone/' . $params['zoneId']; } else { $this->url = BattleNetAPI::getHost() . '/wow/zone/'; } }
function __construct($params) { if (isset($params['realms'])) { if (is_array($params['realms'])) { $params['realms'] = implode(',', $params['realms']); } $this->url = BattleNetAPI::getHost() . '/wow/realm/status?realms=' . $params['realms']; } else { $this->url = BattleNetAPI::getHost() . '/wow/realm/status'; } }
function __construct($params) { if (!isset($params['bracket'])) { throw new BattleNetAPI_Exception('The "/wow/leaderboard/" endpoint requires the parameter "bracket".'); } $validBrackets = array('2v2', '3v3', '5v5', 'rbg'); if (!in_array($params['bracket'], $validBrackets)) { throw new BattleNetAPI_Exception('The "/wow/leaderboard/" endpoint requires the parameter "bracket" be one of the following: "' . implode('", "', $validBrackets) . '".'); } $this->url = BattleNetAPI::getHost() . '/wow/leaderboard/' . $params['bracket']; }
function __construct($params) { if (!isset($params['itemId'])) { throw new BattleNetAPI_Exception('The "/wow/item/" endpoint requires the parameter "itemId".'); } if (isset($params['context'])) { $this->url = BattleNetAPI::getHost() . '/wow/item/' . $params['itemId'] . '/' . $params['context']; } else { $this->url = BattleNetAPI::getHost() . '/wow/item/' . $params['itemId']; } }
function __construct($params) { if (!isset($params['realm'], $params['characterName'])) { throw new BattleNetAPI_Exception('The "/wow/character/" endpoint requires the parameters "realm" and "characterName".'); } $url = BattleNetAPI::getHost() . '/wow/character/' . rawurlencode($params['realm']) . '/' . rawurlencode($params['characterName']); $validFields = array('achievements', 'appearance', 'audit', 'feed', 'guild', 'hunterPets', 'items', 'mounts', 'pets', 'petSlots', 'progression', 'pvp', 'quests', 'reputation', 'statistics', 'stats', 'talents', 'titles'); if (isset($params['fields'])) { if (is_string($params['fields'])) { $params['fields'] = explode(',', $params['fields']); } $params['fields'] = array_intersect($params['fields'], $validFields); $url .= '?fields=' . implode(',', $params['fields']); } $this->url = $url; }
function __construct($params) { if (!isset($params['realm'], $params['guildName'])) { throw new BattleNetAPI_Exception('The "/wow/guild/" endpoint requires the parameters "realm" and "guildName".'); } $url = BattleNetAPI::getHost() . '/wow/guild/' . rawurlencode($params['realm']) . '/' . rawurlencode($params['guildName']); $validFields = array('members', 'achievements', 'news', 'challenge'); if (isset($params['fields'])) { if (is_string($params['fields'])) { $params['fields'] = explode(',', $params['fields']); } $params['fields'] = array_intersect($params['fields'], $validFields); $url .= '?fields=' . implode(',', $params['fields']); } $this->url = $url; }
function __construct($params) { if (!isset($params['speciesId'])) { throw new BattleNetAPI_Exception('The "/wow/pet/stats/" endpoint requires the parameter "speciesId".'); } $queryParams = array(); $queryString = ''; if (isset($params['level'])) { $queryParams['level'] = $params['level']; } if (isset($params['breedId'])) { $queryParams['breedId'] = $params['breedId']; } if (isset($params['qualityId'])) { $queryParams['qualityId'] = $params['qualityId']; } if (!empty($queryParams)) { $queryString = '?' . http_build_query($queryParams); } $this->url = BattleNetAPI::getHost() . '/wow/pet/stats/' . $params['speciesId'] . $queryString; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/mount/'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/challenge/region'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/data/talents'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/data/battlegroups/'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/data/guild/perks'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/data/character/achievements'; }
function __construct($params) { $this->url = BattleNetAPI::getHost() . '/wow/data/item/classes'; }