/** * @return Club */ public function getClub() { if (!$this->club) { $this->club = Club::getByNefubId($this->club_nefub_id); } return $this->club; }
/** * * @param int $nefubId */ public function showClub($nefubId) { $this->subdirectory = '/club'; $this->path = '/' . $nefubId; $this->template = '/club/club.tpl'; if ($this->getClearRender()) { $oClub = Club::getByNefubId($nefubId); if ($oClub) { $competitionGenders = array('Heren', 'Dames', 'Mixed'); $aCompetitions = array(); foreach ($competitionGenders as $competitionGender) { $oGender = Gender::getByNefubName($competitionGender); $aGenreCompetitions = Competition::getAll(array('gender_id' => $oGender->getId(), 'season_nefub_id' => $this->season->nefub_id), 'genre_id`,`name'); $aCompetitions = array_merge($aCompetitions, $aGenreCompetitions); } $aCompetitionTeams = array(); foreach ($aCompetitions as $oCompetition) { $aTeams = Team::getAll(array('competition_nefub_id' => $oCompetition->nefub_id, 'club_nefub_id' => $oClub->nefub_id, 'season_nefub_id' => $oCompetition->season_nefub_id), 'name'); if (count($aTeams)) { $aCompetitionTeams[] = array('competition' => $oCompetition, 'teams' => $aTeams); } } $this->assign('oClub', $oClub); $this->assign('aCompetitionTeams', $aCompetitionTeams); } else { $this->redirect(); } } $this->showOutput(); }
/** * * @param stdClass $club * return Club */ protected function convertClub(stdClass $club) { $oClub = Club::getByNefubId($club->ID); if (!$oClub) { $oClub = new Club(); $oClub->nefub_id = $club->ID; $oClub->name = $club->Name; $oClub->city = $club->Place; if ($club->Website) { $oClub->website = 'http://' . str_replace('http://', '', $club->Website); } $oClub->email = $club->Email; $oClub->save(); } return $oClub; }
protected function showClubs() { switch ($this->mode) { case 'bewerken': $oClub = Club::getByNefubId($this->editId); $this->editObject($oClub); break; default: $aClubs = Club::getAll(array(), 'name'); $this->assign('aClubs', $aClubs); $this->template = '/clubs.tpl'; $this->showOutput(); } }