Пример #1
0
 private static function pokemonFromResult($result)
 {
     $pokemonArr = array();
     if ($result && mysqli_num_rows($result) > 0) {
         foreach ($result as $row) {
             $pokemon = new Pokemon($row);
             array_push($pokemonArr, $pokemon->serialize());
         }
     }
     return $pokemonArr;
 }
Пример #2
0
 public function getPokemon()
 {
     $result = Database::query(SQL::trainerPokemon($this->id));
     $pokemonArr = array();
     if (mysqli_num_rows($result) > 0) {
         foreach ($result as $row) {
             $pokemon = new Pokemon($row);
             array_push($pokemonArr, $pokemon->serialize());
         }
     }
     return $pokemonArr;
 }