本文整理汇总了PHP中Game::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::setId方法的具体用法?PHP Game::setId怎么用?PHP Game::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($id)
{
$game = new Game();
$game->setId($id);
$game = Query::getOne($game);
return $game;
}
示例2: load
static function load($id)
{
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/datas/parties/" . $id) == false) {
return null;
}
$content = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/datas/parties/" . $id));
$instance = new Game();
$instance->setPlayers($content->getPlayers());
$instance->setId($id);
return $instance;
}
示例3: Game
$game = new Game();<br><br>
$params = [<br>
\'opponent\' => \'John\',<br>
\'location\' => \'Outside\',<br>
\'outcome\' => \'L\',<br>
\'datetime\' => \'2015-12-07 10:00:00\',<br>
];<br><br>
$game->setId($id);<br>
$game = GameController::edit($game, $params);<br>
</div>
';
$game = new Game();
$params = ['opponent' => 'John', 'location' => 'Outside', 'outcome' => 'L', 'datetime' => '2015-12-07 10:00:00'];
$game->setId($id);
$game = GameController::edit($game, $params);
$test_data .= '<div class="bg-success pad">';
foreach ($game as $key => $value) {
$test_data .= $key . ' : ' . $value . '<br>';
}
$test_data .= '</div>';
$body = '
<ol class="breadcrumb">
<li><a href="index.php">Getting Started</a></li>
<li><a class="active">Initial Testing</a></li>
</ol>
<div class="row">
<div class="col-md-8">
<p>Now that your scripts are generated, we will test the generated code. There are a set of default queries that can be used for basic CRUD. These will be our main focus to ensure the files were setup correctly.</p>