Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * 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 [];
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }
Ejemplo n.º 4
0
 /**
  * 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);
 }
Ejemplo n.º 5
0
 /**
  * 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()));
 }
Ejemplo n.º 6
0
 /**
  * Get spell.
  *
  * @param int $spellId
  * @return array
  */
 public function getSpell($spellId)
 {
     return $this->client->fetchData('spell/' . intval($spellId), [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 7
0
 /**
  * Get recipe.
  *
  * @param int $recipeId
  * @return array
  */
 public function getRecipe($recipeId)
 {
     return $this->client->fetchData('recipe/' . intval($recipeId), [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 8
0
 /**
  * Get artisan.
  *
  * @param string $artisan
  * @return array
  */
 public function getArtisan($artisan)
 {
     return $this->client->fetchData('data/artisan/' . $artisan, [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 9
0
 /**
  * Get boss.
  *
  * @param int $bossId
  * @return array
  */
 public function getBoss($bossId)
 {
     return $this->client->fetchData('boss/' . intval($bossId), [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 10
0
 /**
  * Get mounts.
  *
  * @return array
  */
 public function getMounts()
 {
     return $this->client->fetchData('mount/', [], 'mounts', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 11
0
 /**
  * Get ladder.
  *
  * @param int $ladderId
  * @return array
  */
 public function getLadder($ladderId)
 {
     return $this->client->fetchData('ladder/' . intval($ladderId), [], '', $this->client->getSeconds(Cache::getLifetimeShort()));
 }
Ejemplo n.º 12
0
 /**
  * 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()));
 }
Ejemplo n.º 13
0
 /**
  * Get pvp leaderboard rated.
  *
  * @return array
  */
 public function getLeaderboardRated()
 {
     return $this->client->fetchData('leaderboard/rbg', [], 'rows', $this->client->getSeconds(Cache::getLifetimeShort()));
 }
Ejemplo n.º 14
0
 /**
  * Get rewards.
  *
  * @return array
  */
 public function getRewards()
 {
     return $this->client->fetchData('data/rewards', [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 15
0
 /**
  * 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);
 }
Ejemplo n.º 16
0
 /**
  * Get quest.
  *
  * @param $questId
  * @return array
  */
 public function getQuest($questId)
 {
     return $this->client->fetchData('quest/' . intval($questId), [], '', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 17
0
 /**
  * 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()));
 }
Ejemplo n.º 18
0
 /**
  * Get pet types.
  *
  * @return array
  */
 public function getPetTypes()
 {
     return $this->client->fetchData('data/pet/types', [], 'petTypes', $this->client->getSeconds(Cache::getLifetimeLong()));
 }
Ejemplo n.º 19
0
 /**
  * Get realms.
  *
  * @return array
  */
 public function getRealms()
 {
     return $this->client->fetchData('realm/status', [], 'realms', $this->client->getSeconds(Cache::getLifetimeShort()));
 }