function display($id) { $game = new Game(); $game->setId($id); $game = Query::getOne($game); return $game; }
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; }
$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>