/** * 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); }
/** * 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); }
/** * 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 []; }
/** * 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 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 ladder. * * @param int $ladderId * @return array */ public function getLadder($ladderId) { return $this->client->fetchData('ladder/' . intval($ladderId), [], '', $this->client->getSeconds(Cache::getLifetimeShort())); }
/** * Get pvp leaderboard rated. * * @return array */ public function getLeaderboardRated() { return $this->client->fetchData('leaderboard/rbg', [], 'rows', $this->client->getSeconds(Cache::getLifetimeShort())); }
/** * 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 realms. * * @return array */ public function getRealms() { return $this->client->fetchData('realm/status', [], 'realms', $this->client->getSeconds(Cache::getLifetimeShort())); }