@@ 228-246 (lines=19) @@ | ||
225 | * |
|
226 | * @return MountsValueObject |
|
227 | */ |
|
228 | public function getMounts() |
|
229 | { |
|
230 | $requestModel = $this->prepareRequestModel('mounts'); |
|
231 | $response = $this->requestService->doRequest($requestModel); |
|
232 | $responseObject = json_decode($response); |
|
233 | ||
234 | $collectedMounts = []; |
|
235 | foreach ($responseObject->mounts->collected as $mount) { |
|
236 | $collectedMounts[] = $this->prepareMountValueObject($mount); |
|
237 | } |
|
238 | ||
239 | $mounts = new MountsValueObject( |
|
240 | $responseObject->mounts->numCollected, |
|
241 | $responseObject->mounts->numNotCollected, |
|
242 | $collectedMounts |
|
243 | ); |
|
244 | ||
245 | return $mounts; |
|
246 | } |
|
247 | ||
248 | /** |
|
249 | * A list of the battle pets obtained by the character |
|
@@ 253-271 (lines=19) @@ | ||
250 | * |
|
251 | * @return PetsValueObject |
|
252 | */ |
|
253 | public function getPets() |
|
254 | { |
|
255 | $requestModel = $this->prepareRequestModel('pets'); |
|
256 | $response = $this->requestService->doRequest($requestModel); |
|
257 | $responseObject = json_decode($response); |
|
258 | ||
259 | $collectedPets = []; |
|
260 | foreach ($responseObject->pets->collected as $pet) { |
|
261 | $collectedPets[] = $this->preparePetValueObject($pet); |
|
262 | } |
|
263 | ||
264 | $pets = new PetsValueObject( |
|
265 | $responseObject->pets->numCollected, |
|
266 | $responseObject->pets->numNotCollected, |
|
267 | $collectedPets |
|
268 | ); |
|
269 | ||
270 | return $pets; |
|
271 | } |
|
272 | ||
273 | /** |
|
274 | * Data about the current battle pet slots on this characters account |
|
@@ 278-296 (lines=19) @@ | ||
275 | * |
|
276 | * @return PetSlotsValueObject[] |
|
277 | */ |
|
278 | public function getPetSlots() |
|
279 | { |
|
280 | $requestModel = $this->prepareRequestModel('petSlots'); |
|
281 | $response = $this->requestService->doRequest($requestModel); |
|
282 | $responseObject = json_decode($response); |
|
283 | $petSlots = []; |
|
284 | ||
285 | foreach ($responseObject->petSlots as $petSlot) { |
|
286 | $petSlots[] = new PetSlotsValueObject( |
|
287 | $petSlot->slot, |
|
288 | $petSlot->battlePetGuid, |
|
289 | $petSlot->isEmpty, |
|
290 | $petSlot->isLocked, |
|
291 | $petSlot->abilities |
|
292 | ); |
|
293 | } |
|
294 | ||
295 | return $petSlots; |
|
296 | } |
|
297 | ||
298 | /** |
|
299 | * A list of the character's professions. Does not include class professions |
|
@@ 383-401 (lines=19) @@ | ||
380 | * |
|
381 | * @return ReputationValueObject[] |
|
382 | */ |
|
383 | public function getReputation() |
|
384 | { |
|
385 | $requestModel = $this->prepareRequestModel('reputation'); |
|
386 | $response = $this->requestService->doRequest($requestModel); |
|
387 | $responseObject = json_decode($response); |
|
388 | $reputations = []; |
|
389 | ||
390 | foreach ($responseObject->reputation as $reputation) { |
|
391 | $reputations[] = new ReputationValueObject( |
|
392 | $reputation->id, |
|
393 | $reputation->name, |
|
394 | $reputation->standing, |
|
395 | $reputation->value, |
|
396 | $reputation->max |
|
397 | ); |
|
398 | } |
|
399 | ||
400 | return $reputations; |
|
401 | } |
|
402 | ||
403 | /** |
|
404 | * A list of talent structures |