function OnLoadPageData()
 {
     # new data manager
     $o_comp_manager = new CompetitionManager($this->GetSettings(), $this->GetDataConnection());
     # get competitions
     $o_comp_manager->SetExcludeInactive(!AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_COMPETITIONS));
     $o_comp_manager->ReadCompetitionsInCategories();
     $this->competitions = $o_comp_manager->GetItems();
     # tidy up
     unset($o_comp_manager);
 }
 function OnLoadPageData()
 {
     require_once 'stoolball/competition-manager.class.php';
     $comp_manager = new CompetitionManager($this->GetSettings(), $this->GetDataConnection());
     $comp_manager->ReadCompetitionsInCategories(array(17, 33, 45, 61, 62, 72, 73));
     $competitions = $comp_manager->GetItems();
     unset($comp_manager);
     $season_ids = array();
     foreach ($competitions as $competition) {
         /*@var $competition Competition */
         $season = $competition->GetLatestSeason();
         $season_ids[] = $season->GetId();
     }
     # Fixtures
     require_once 'stoolball/match-manager.class.php';
     $match_manager = new MatchManager($this->GetSettings(), $this->GetDataConnection());
     $match_manager->FilterByMaximumResults(5);
     $match_manager->FilterByDateStart(gmdate('U'));
     $match_manager->ReadBySeasonId($season_ids);
     $this->matches = $match_manager->GetItems();
     unset($match_manager);
     # Get stats highlights
     require_once 'stoolball/statistics/statistics-manager.class.php';
     $statistics_manager = new StatisticsManager($this->GetSettings(), $this->GetDataConnection());
     $statistics_manager->FilterBySeason($season_ids);
     $statistics_manager->FilterMaxResults(1);
     $this->best_batting = $statistics_manager->ReadBestBattingPerformance();
     $this->best_bowling = $statistics_manager->ReadBestBowlingPerformance();
     $this->most_runs = $statistics_manager->ReadBestPlayerAggregate("runs_scored");
     $this->most_wickets = $statistics_manager->ReadBestPlayerAggregate("wickets");
     $this->most_catches = $statistics_manager->ReadBestPlayerAggregate("catches");
     # See what stats we've got available
     $best_batting_count = count($this->best_batting);
     $best_bowling_count = count($this->best_bowling);
     $best_batters = count($this->most_runs);
     $best_bowlers = count($this->most_wickets);
     $best_catchers = count($this->most_catches);
     $this->has_player_stats = ($best_batting_count or $best_batters or $best_bowling_count or $best_bowlers or $best_catchers);
     unset($statistics_manager);
 }