本文整理汇总了PHP中Team::getByNefubId方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::getByNefubId方法的具体用法?PHP Team::getByNefubId怎么用?PHP Team::getByNefubId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Team
的用法示例。
在下文中一共展示了Team::getByNefubId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTeam
/**
* @return Team
*/
public function getTeam()
{
if (!$this->team) {
$this->team = Team::getByNefubId($this->team_nefub_id);
}
return $this->team;
}
示例2: runTeamSchedule
protected function runTeamSchedule($nefubId, $date)
{
if (is_numeric($nefubId) && $date) {
if ($oTeam = Team::getByNefubId($nefubId)) {
$formattedDate = strftime("%A %e %B %Y", strtotime($date));
$filename = 'agenda ' . $date . ' ' . $oTeam->name;
$oSeason = Season::getInstance();
$query = "SELECT Game.id FROM Game WHERE Game.date = '" . $date . "' \n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t(\tGame.team1_nefub_id = '" . $oTeam->nefub_id . "' OR\n\t\t\t\t\t\t\t\t\tGame.team2_nefub_id = '" . $oTeam->nefub_id . "' OR\n\t\t\t\t\t\t\t\t\tGame.ref_team_nefub_id = '" . $oTeam->nefub_id . "')\n\t\t\t\t\t\t\tORDER BY Game.time, Game.field;\n\t\t\t\t\t\t";
$aGames = Game::getAllFromQuery($query);
if (count($aGames)) {
$title = 'Programma ' . $formattedDate . ' voor ' . utf8_decode($oTeam->name) . ' (' . $oTeam->getCompetition()->name . ')';
$footer = $title . '. Gedownload van http://' . $_SERVER['HTTP_HOST'] . '/team/' . $nefubId;
$this->renderGames($filename, $title, $aGames, $footer, false);
}
}
}
$this->redirect();
}
示例3: showTeam
/**
*
* @param int $nefubId
*/
public function showTeam($nefubId = null)
{
$this->subdirectory = '/team';
if ($nefubId) {
$this->path = '/' . $nefubId;
$this->template = '/team/team.tpl';
if ($this->getClearRender()) {
$oTeam = Team::getByNefubId($nefubId);
if ($oTeam) {
$this->assign('oTeam', $oTeam);
$finishedGames = $oTeam->getFinishedGames();
$aPlannedGames = $oTeam->getPlannedGames();
$finishedGamesCount = count($finishedGames);
$plannedGamesCount = count($plannedGames);
$players = $oTeam->getTeamPersons();
$playerCount = count($players);
$this->assign('playerCount', $playerCount);
$this->assign('aFinishedGames', $oTeam->getFinishedGames());
$this->assign('finishedGamesCount', $finishedGamesCount);
$this->assign('aPlannedGames', $aPlannedGames);
$this->assign('plannedGamesCount', $plannedGamesCount);
} else {
$this->redirect('/team');
}
}
} else {
$this->path = '/index';
$this->template = '/team/view.tpl';
if ($this->getClearRender()) {
$aSortedTeams = Team::getSortedByAlphabet();
$this->assign('aSortedTeams', $aSortedTeams);
}
}
$this->showOutput();
}
示例4: updateTeams
public function updateTeams()
{
$aPoules = Poule::getAll(array('season_nefub_id' => Season::getInstance()->nefub_id), 'competition_nefub_id');
foreach ($aPoules as $oPoule) {
$aPouleTeams = $oPoule->getPouleTeams();
foreach ($aPouleTeams as $oPouleTeam) {
$team = $this->getAPITeamDetails($oPouleTeam->team_nefub_id);
$oTeam = Team::getByNefubId($team->ID);
if (!$oTeam) {
$oTeam = new Team();
$oTeam->nefub_id = $team->ID;
$oTeam->name = $team->Name;
$oTeam->competition_nefub_id = $oPoule->competition_nefub_id;
$oTeam->season_nefub_id = $oPoule->getCompetition()->season_nefub_id;
$oTeam->club_nefub_id = $team->Club->ID;
$oTeam->color_shirt = $team->Dress->Shirt;
$oTeam->color_shorts = $team->Dress->Short;
self::put('Team ' . $team->Name . ' toegevoegd');
$oTeam->save();
}
if (isset($team->Players) && is_array($team->Players)) {
foreach ($team->Players as $teamPlayer) {
$this->convertTeamPerson($teamPlayer, $oTeam);
}
} else {
self::put('Geen spelers gevonden voor ' . $team->Name);
}
$this->retrieveClub($team->Club);
$this->retrieveTeamGames($team, 'schedule');
$query = "SELECT COUNT(Game.nefub_id) as countGames\n\t\t\t\t\t\t\tFROM Game\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t(team1_nefub_id = '" . $team->ID . "'\n\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\tteam2_nefub_id = '" . $team->ID . "')\n\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\tGame.date <= CURDATE()";
$rows = Database::select_rows_by_query($query);
$playedGames = $rows[0]['countGames'];
$bRetrieveResults = false;
if ($playedGames) {
// Als er geen oude wedstrijden in de DB staan, vermoedelijk zijn ze dan niet eerder opgehaald.
$query .= " AND Game.actions_retrieved = 0";
$rows = Database::select_rows_by_query($query);
$gamesToRetrieve = $rows[0]['countGames'];
$bRetrieveResults = $gamesToRetrieve != 0;
}
if ($bRetrieveResults) {
$this->retrieveTeamGames($team, 'results');
} else {
self::put('Resultaten voor ' . $oTeam->name . ' hoeven niet vernieuwd te worden');
}
$oTeam->save();
$this->retrievedTeamNefubIds[$oPouleTeam->team_nefub_id] = true;
}
}
}
示例5: showTeams
protected function showTeams()
{
switch ($this->mode) {
case 'bewerken':
$oTeam = Team::getByNefubId($this->editId);
$this->editObject($oTeam);
break;
default:
$this->showCompetitionDependentView('/teams.tpl');
}
}
示例6: getTeam2
/**
* Enter description here ...
* @return Team
*/
public function getTeam2()
{
return Team::getByNefubId($this->team2_nefub_id);
}