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); }