Esempio n. 1
0
  public List getGameList() {
    // game_info row정보
    List<GameInfo> list = gameMapper.getGameList();

    for (GameInfo i : list) {
      Long teamSrl = i.getAwayTeamSrl();
      System.out.println(teamSrl);
    }

    // game_info.team_srl로 TeamInfo instance생성해야됨
    for (int i = 0; i < list.size(); i++) {
      //            System.out.println(list.get(i).getClass());
      //            for (String key: list.get(i).keySet()) {
      // System.out.println(list.get(i).get(key));
      //            }

      /*
      $gameObj = Game::instance();
      $gameObj->setHomeTeam($list[$i]['homeTeamSrl']);
      $gameObj->setAwayTeam($list[$i]['awayTeamSrl']);

      $gameList[$list[$i]['gameSrl']] = $gameObj;

      // team instance 생성도...안되는거 아닌가..
      */
    }

    return list;
  }
Esempio n. 2
0
  // 일자별 게임 리스트
  public List getGameListByDate(String date) {
    String tmpDate = date + "%";
    List<GameInfo> list = gameMapper.getGameListByDate(tmpDate);
    List<Game> gameList = new ArrayList<Game>();

    for (GameInfo i : list) {
      Long awaySrl = i.getAwayTeamSrl();
      Long homeSrl = i.getHomeTeamSrl();

      Team awayTeam = teamMapper.getTeamInfo(awaySrl);
      Team homeTeam = teamMapper.getTeamInfo(homeSrl);

      Game game =
          new Game(
              homeTeam,
              awayTeam,
              i.getDate(),
              i.getHomeScore(),
              i.getAwayScore(),
              i.getFlagBroadcast());
      gameList.add(game);
    }

    return gameList;
  }