Esempio n. 1
1
 public function getBadges()
 {
     $result = Database::query(SQL::trainerBadges($this->id));
     $badges = array();
     if (mysqli_num_rows($result) > 0) {
         foreach ($result as $row) {
             $badge = new Badge($row);
             array_push($badges, $badge->serialize());
         }
     }
     return $badges;
 }
Esempio n. 2
0
 private static function badgesForResult($result)
 {
     $badges = array();
     if ($result && mysqli_num_rows($result) > 0) {
         foreach ($result as $row) {
             $badge = new Badge($row);
             array_push($badges, $badge->serialize());
         }
     }
     return $badges;
 }