function OnLoadPageData() { # new data manager $o_manager = new ClubManager($this->GetSettings(), $this->GetDataConnection()); # get teams $o_manager->ReadAll(); $this->a_clubs = $o_manager->GetItems(); # tidy up unset($o_manager); }
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(); } # tidy up unset($this->manager); }
function OnPostback() { $this->school = $this->edit->GetDataObject(); # save data if valid if ($this->IsValid()) { require_once "stoolball/clubs/club-manager.class.php"; $club_manager = new ClubManager($this->GetSettings(), $this->GetDataConnection()); $id = $club_manager->Save($this->school); $this->school->SetId($id); $this->Redirect($this->school->GetNavigateUrl() . "/edit"); } }
public function OnLoadPageData() { $id = $this->school_manager->GetItemId(); $this->school_manager->ReadById(array($id)); $this->school = $this->school_manager->GetFirst(); unset($this->school_manager); $this->ground_manager->ReadGroundForSchool($this->school); $ground = $this->ground_manager->GetFirst(); if ($ground instanceof Ground) { $this->school->Ground()->SetId($ground->GetId()); $this->school->Ground()->SetAddress($ground->GetAddress()); } }
function OnLoadPageData() { # check parameter if (!isset($_GET['item']) or !is_numeric($_GET['item'])) { $this->Redirect(); } # new data manager $o_manager = new ClubManager($this->GetSettings(), $this->GetDataConnection()); # get teams $o_manager->ReadById(array($_GET['item'])); $this->club = $o_manager->GetFirst(); # must have found a team if (!$this->club instanceof Club) { $this->Redirect(); } # tidy up unset($o_manager); }