| @@ 603-624 (lines=22) @@ | ||
| 600 | // Trainers |
|
| 601 | ////////////// |
|
| 602 | ||
| 603 | public function getTrainers($trainer_name, $team, $page, $ranking) |
|
| 604 | { |
|
| 605 | $trainers = $this->getTrainerData($trainer_name, $team, $page, $ranking); |
|
| 606 | foreach ($trainers as $trainer) { |
|
| 607 | $trainer->rank = $this->getTrainerLevelRating($trainer->level)->rank; |
|
| 608 | $active_gyms = 0; |
|
| 609 | $pkmCount = 0; |
|
| 610 | $trainer->pokemons = array(); |
|
| 611 | $active_pokemon = $this->getTrainerActivePokemon($trainer->name); |
|
| 612 | foreach ($active_pokemon as $pokemon) { |
|
| 613 | ++$active_gyms; |
|
| 614 | $trainer->pokemons[$pkmCount++] = $pokemon; |
|
| 615 | } |
|
| 616 | $inactive_pokemon = $this->getTrainerInactivePokemon($trainer->name); |
|
| 617 | foreach ($inactive_pokemon as $pokemon) { |
|
| 618 | $trainer->pokemons[$pkmCount++] = $pokemon; |
|
| 619 | } |
|
| 620 | $trainer->gyms = ''.$active_gyms; |
|
| 621 | } |
|
| 622 | ||
| 623 | return $trainers; |
|
| 624 | } |
|
| 625 | ||
| 626 | public function getTrainerLevelCount($team_id) |
|
| 627 | { |
|
| @@ 621-642 (lines=22) @@ | ||
| 618 | // Trainers |
|
| 619 | ////////////// |
|
| 620 | ||
| 621 | public function getTrainers($trainer_name, $team, $page, $ranking) |
|
| 622 | { |
|
| 623 | $trainers = $this->getTrainerData($trainer_name, $team, $page, $ranking); |
|
| 624 | foreach ($trainers as $trainer) { |
|
| 625 | $trainer->rank = $this->getTrainerLevelRating($trainer->level)->rank; |
|
| 626 | $active_gyms = 0; |
|
| 627 | $pkmCount = 0; |
|
| 628 | $trainer->pokemons = array(); |
|
| 629 | $active_pokemon = $this->getTrainerActivePokemon($trainer->name); |
|
| 630 | foreach ($active_pokemon as $pokemon) { |
|
| 631 | ++$active_gyms; |
|
| 632 | $trainer->pokemons[$pkmCount++] = $pokemon; |
|
| 633 | } |
|
| 634 | $inactive_pokemon = $this->getTrainerInactivePokemon($trainer->name); |
|
| 635 | foreach ($inactive_pokemon as $pokemon) { |
|
| 636 | $trainer->pokemons[$pkmCount++] = $pokemon; |
|
| 637 | } |
|
| 638 | $trainer->gyms = ''.$active_gyms; |
|
| 639 | } |
|
| 640 | ||
| 641 | return $trainers; |
|
| 642 | } |
|
| 643 | ||
| 644 | public function getTrainerLevelCount($team_id) |
|
| 645 | { |
|