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/team-manager.class.php"; $team_manager = new TeamManager($this->GetSettings(), $this->GetDataConnection()); $team_manager->FilterByActive(true); $team_manager->ReadById(); $this->teams = $team_manager->GetItems(); require_once "stoolball/competition-manager.class.php"; $comp_manager = new CompetitionManager($this->GetSettings(), $this->GetDataConnection()); $comp_manager->SetExcludeInactive(true); $comp_manager->ReadById(); $this->competitions = $comp_manager->GetItems(); }
function OnLoadPageData() { # new data managers $o_comp_manager = new CompetitionManager($this->GetSettings(), $this->GetDataConnection()); $o_team_manager = new TeamManager($this->GetSettings(), $this->GetDataConnection()); # get comps $o_comp_manager->SetExcludeInactive(true); $o_comp_manager->ReadAllSummaries(); $this->a_comps = $o_comp_manager->GetItems(); # get teams $o_team_manager->FilterByActive(true); foreach ($this->a_comps as $o_comp) { /* @var $o_comp Competition */ $a_seasons = array($o_comp->GetLatestSeason()->GetId()); $o_team_manager->ReadBySeasonId($a_seasons); while ($o_team_manager->MoveNext()) { $o_comp->GetLatestSeason()->AddTeam($o_team_manager->GetItem()); } $o_team_manager->Clear(); } # tidy up unset($o_comp_manager); unset($o_team_manager); }