function OnLoadPageData()
 {
     # get item to be deleted
     if (!is_object($this->data_object)) {
         $id = $this->manager->GetItemId($this->data_object);
         $this->manager->ReadById(array($id));
         $this->data_object = $this->manager->GetFirst();
         # How many seasons in this competition?
         if (is_object($this->data_object) and $this->data_object->GetCompetition() instanceof Competition and $this->data_object->GetCompetition()->GetId()) {
             $this->manager->Clear();
             $this->manager->ReadByCompetitionId(array($this->data_object->GetCompetition()->GetId()));
             $this->seasons_in_competition = $this->manager->GetCount();
         }
     }
     # tidy up
     unset($this->manager);
 }
 function OnLoadPageData()
 {
     # get id of season
     $i_id = $this->season_manager->GetItemId($this->season);
     # read season data when first asked to edit a season
     if ($i_id and !$this->IsPostback()) {
         $this->season_manager->ReadById(array($i_id));
         $this->season = $this->season_manager->GetFirst();
     }
     # get all teams
     $this->team_manager->SetGroupInactiveLast(false);
     $this->team_manager->ReadAll();
     $this->edit->SetTeams($this->team_manager->GetItems());
     # tidy up
     unset($this->season_manager);
     unset($this->team_manager);
 }