예제 #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;
 }
예제 #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;
 }