/** * Career constructor. * * @param string $battleTag * @param int $heroId * @param bool $forceFetch */ public function __construct($battleTag, $heroId, $forceFetch = false) { $client = new Client('d3'); // Get data. $path = 'profile/' . $battleTag . '/hero/' . intval($heroId); $this->data = $client->fetchData($path, [], '', $client->getSeconds(Cache::getLifetimeShort()), $forceFetch); }
/** * Get auction details. * * @param string $realm * @return array */ public function getAuctions($realm) { $data = $this->client->fetchData('auction/data/' . $realm, [], 'files', $this->client->getSeconds(Cache::getLifetimeShort())); if (isset($data[0])) { return $data[0]; } return []; }
/** * Character constructor. * * @param string $realm * @param string $character * @param bool $forceFetch */ public function __construct($realm, $character, $forceFetch = false) { $client = new Client('wow'); // Get data. $params = ['fields' => $this->fields]; $path = 'character/' . $realm . '/' . $character; $this->data = $client->fetchData($path, $params, '', $client->getSeconds(Cache::getLifetimeShort()), $forceFetch); }
/** * Profile constructor. * * @param int $profileId * @param int $region * @param string $name * @param bool $forceFetch */ public function __construct($profileId, $region, $name, $forceFetch = false) { $this->client = new Client('sc2'); // Get data. $this->seconds = Cache::getLifetimeShort(); $this->profileId = $profileId; $this->region = $region; $this->name = $name; $this->forceFetch = $forceFetch; $path = 'profile/' . intval($profileId) . '/' . intval($region) . '/' . $name . '/'; $this->data = $this->client->fetchData($path, [], '', $this->client->getSeconds($this->seconds), $forceFetch); }
/** * Get item set. * * @param int $setId * @return array */ public function getItemSet($setId) { return $this->client->fetchData('item/set/' . intval($setId), [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get spell. * * @param int $spellId * @return array */ public function getSpell($spellId) { return $this->client->fetchData('spell/' . intval($spellId), [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get recipe. * * @param int $recipeId * @return array */ public function getRecipe($recipeId) { return $this->client->fetchData('recipe/' . intval($recipeId), [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get artisan. * * @param string $artisan * @return array */ public function getArtisan($artisan) { return $this->client->fetchData('data/artisan/' . $artisan, [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get boss. * * @param int $bossId * @return array */ public function getBoss($bossId) { return $this->client->fetchData('boss/' . intval($bossId), [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get mounts. * * @return array */ public function getMounts() { return $this->client->fetchData('mount/', [], 'mounts', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get ladder. * * @param int $ladderId * @return array */ public function getLadder($ladderId) { return $this->client->fetchData('ladder/' . intval($ladderId), [], '', $this->client->getSeconds(Cache::getLifetimeShort())); }
/** * Get achievement. * * @param int $achievementId * @return array */ public function getAchievement($achievementId) { $path = 'achievement/' . intval($achievementId); return $this->client->fetchData($path, [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get pvp leaderboard rated. * * @return array */ public function getLeaderboardRated() { return $this->client->fetchData('leaderboard/rbg', [], 'rows', $this->client->getSeconds(Cache::getLifetimeShort())); }
/** * Get rewards. * * @return array */ public function getRewards() { return $this->client->fetchData('data/rewards', [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Career constructor. * * @param string $battleTag * @param bool $forceFetch */ public function __construct($battleTag, $forceFetch = false) { $client = new Client('d3'); // Get data. $this->data = $client->fetchData('profile/' . $battleTag . '/', [], '', $client->getSeconds(Cache::getLifetimeShort()), $forceFetch); }
/** * Get quest. * * @param $questId * @return array */ public function getQuest($questId) { return $this->client->fetchData('quest/' . intval($questId), [], '', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get pet stats. * * @param int $speciesId * @param int $level * @param int $breedId * @param int $qualityId * @return array */ public function getPetStats($speciesId, $level = 1, $breedId = 3, $qualityId = 1) { return $this->client->fetchData('pet/stats/' . intval($speciesId), ['level' => intval($level), 'breedId' => intval($breedId), 'qualityId' => intval($qualityId)], '', $this->client->getSeconds(Cache::getLifetimeShort())); }
/** * Get pet types. * * @return array */ public function getPetTypes() { return $this->client->fetchData('data/pet/types', [], 'petTypes', $this->client->getSeconds(Cache::getLifetimeLong())); }
/** * Get realms. * * @return array */ public function getRealms() { return $this->client->fetchData('realm/status', [], 'realms', $this->client->getSeconds(Cache::getLifetimeShort())); }