本文整理汇总了PHP中Game::getByNefubId方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::getByNefubId方法的具体用法?PHP Game::getByNefubId怎么用?PHP Game::getByNefubId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::getByNefubId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGame
/**
* @return Game
*/
public function getGame()
{
if (!$this->game) {
$this->game = Game::getByNefubId($this->game_nefub_id);
}
return $this->game;
}
示例2: addGameRow
public function addGameRow(Game $oGame, $includeField = true)
{
$oGame = Game::getByNefubId($oGame->nefub_id);
$field = $oGame->field ? $oGame->field : 1;
$gameType = $oGame->getCompetition()->getGender()->name . ' ' . $oGame->getCompetition()->getGenre()->name;
$team1 = utf8_decode($oGame->getTeam1()->name);
$team2 = utf8_decode($oGame->getTeam2()->name);
if ($oGame->getFirstReferee()) {
$oGame = new Game($oGame->getId());
$oReferee = $oGame->getFirstReferee();
$referee = utf8_decode($oReferee->getName());
if (!$oReferee->getPerson()) {
$referee .= ' (' . $oReferee->getTeam()->getCompetition()->getGender()->name;
$referee .= ' ' . $oReferee->getTeam()->getCompetition()->getGenre()->name . ')';
}
} else {
$referee = 'Onbekend';
}
$text = $oGame->getFormattedTime();
$text .= "\t";
$text .= $team1;
$text .= "\t";
$text .= $team2;
$text .= "\n";
$text .= $gameType;
if ($includeField) {
$text .= $field;
}
$this->section->addText($text, array('name' => 'Arial', 'size' => 10, 'bold' => false));
}
示例3: showGame
/**
*
* @param int $nefubId
*/
public function showGame($nefubId)
{
$this->subdirectory = '/wedstrijd';
$this->path = '/' . $nefubId;
$this->template = '/game/game.tpl';
if ($this->getClearRender()) {
$oGame = Game::getByNefubId($nefubId);
if ($oGame) {
$this->assign('oSeason', $oSeason);
$this->assign('bShowShots', $oGame->poule_type_id != GAME_TYPE_KLEINVELD);
$this->assign('oGame', $oGame);
$gameActions = $oGame->getActions();
$this->assign('gameActions', $gameActions);
if (count($gameActions) == 0) {
$this->assign('noGameActions', true);
}
} else {
$this->redirect();
}
}
$this->showOutput();
}
示例4: convertGame
/**
*
* @param stdClass $game
* @param int $teamNefubId
* @param Game $oGame
* @return Game
*/
protected function convertGame(stdClass $game)
{
$oGame = Game::getByNefubId($game->ID);
if (!$oGame) {
$oGame = new Game();
$oGame->nefub_id = $game->ID;
$this->addedNefubObject($oGame);
}
if ($oGame->actions_retrieved == 1) {
return $oGame;
}
if (count($game->{'Match Officials'})) {
$referees = $game->{'Match Officials'};
// Backwards compatability
if ($referees[0]->Team) {
$oGame->ref_team_nefub_id = $referees[0]->Team->ID;
}
foreach ($referees as $referee) {
$this->convertReferee($oGame, $referee);
}
}
$oGame->team1_nefub_id = $game->Home->ID;
$oGame->team2_nefub_id = $game->Away->ID;
$oLocation = LocationMapper::mapFromAPI($game->Location);
$oGame->location_nefub_id = $oLocation->nefub_id;
$oGame->field = $game->Field;
list($gameDay, $gameMonth, $gameYear) = explode('-', $game->Date);
$oGame->date = $gameYear . '-' . $gameMonth . '-' . $gameDay;
$oGame->time = $game->Time;
$oGame->finished = isset($game->Result) && is_object($game->Result);
$oCompetition = CompetitionMapper::mapFromAPI($game->Competition);
$oGame->competition_nefub_id = $oCompetition->nefub_id;
$oGame->season_nefub_id = $oCompetition->season_nefub_id;
if ($oGame->finished) {
$oGame->team1_score = $game->Result->Home;
$oGame->team2_score = $game->Result->Away;
$oGame->team1_shots = $game->Shots->Home;
$oGame->team2_shots = $game->Shots->Away;
if (!$oGame->actions_retrieved) {
$this->convertGamePersons($game->Formation->Home, $game->Home->ID, $oGame);
$this->convertGamePersons($game->Formation->Away, $game->Away->ID, $oGame);
Database::delete_rows('GameAction', array('game_nefub_id' => $oGame->nefub_id));
$this->convertGameActions($game->Events, $oGame);
Game::updateActionsRetrieved($oGame);
}
}
$oGame->save();
$this->retrievedScheduledGameNefubIds[$oGame->nefub_id] = $oGame;
return $oGame;
}
示例5: showGames
protected function showGames()
{
switch ($this->mode) {
case 'bewerken':
$oGame = Game::getByNefubId($this->editId);
$this->editObject($oGame);
break;
case 'competitie':
$oCompetition = Competition::getByNefubId($this->editId);
$this->assign('oCompetition', $oCompetition);
$this->template = '/competitie.wedstrijden.tpl';
$this->showOutput();
break;
default:
$this->showCompetitionDependentView('/competities.wedstrijden.tpl');
}
}