本文整理汇总了PHP中Game::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::set方法的具体用法?PHP Game::set怎么用?PHP Game::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListJuegoDetalleFactura
function getListJuegoDetalleFactura($condicion = null, $parametros = array())
{
if ($condicion === null) {
$condicion = "";
} else {
$condicion = "where {$condicion}";
}
$sql = "select ju.*, de.*, fa.*, cl.* from detalle de \r\n left join juego ju on ju.id_juego = de.id_juego \r\n left join factura fa on fa.num_factura = de.num_factura \r\n left join cliente cl on fa.id_cliente = cl.id_cliente \r\n {$condicion} ORDER BY cl.email, fa.fecha desc ";
$this->bd->send($sql, $parametros);
$r = array();
$contador = 0;
while ($fila = $this->bd->getRow()) {
$juego = new Game();
$juego->set($fila);
$detalle = new Detalle();
$detalle->set($fila, 8);
$factura = new Factura();
$factura->set($fila, 13);
$cliente = new User();
$cliente->set($fila, 16);
$r[$contador]["juego"] = $juego;
$r[$contador]["factura"] = $factura;
$r[$contador]["detalle"] = $detalle;
$r[$contador]["cliente"] = $cliente;
$contador++;
}
return $r;
}
示例2: get
function get($ID)
{
$parametros = array();
$parametros['ID'] = $ID;
$this->bd->select($this->tabla, "*", "id_juego=:ID", $parametros);
$fila = $this->bd->getRow();
$game = new Game();
$game->set($fila);
return $game;
}
示例3: array
/**
* Schedule one set of games, using weighted field assignment
*
* Takes an array of teams and a datestamp. From this:
* - iterate over teams array pairwise and call add_teams_balanced() to create a game with balanced home/away
* - iterate over all newly-created games, and assign fields based on region preference.
* All of this is performed in a transaction and rolled back if any game fails.
*/
function schedule_one_set($teams, $datestamp, $should_publish = true)
{
global $dbh;
$dbh->beginTransaction();
$games_list = array();
for ($team_idx = 0; $team_idx < count($teams); $team_idx += 2) {
$g = new Game();
$g->set('league_id', $this->league_id);
$g->add_teams_balanced($teams[$team_idx], $teams[$team_idx + 1]);
$g->set('published', $should_publish);
if (!$g->save()) {
if (!$dbh->rollback()) {
$extra_errors = "<br />Also, failed to roll back transaction. Please contact the system administrator";
}
return array(false, "Could not create the games you requested, during addition of opponents.{$extra_errors}");
}
$games_list[] = $g;
}
try {
$this->assign_fields_by_preferences($games_list, $datestamp);
} catch (Exception $e) {
$extra_errors = $e->getMessage();
if (!$dbh->rollback()) {
$extra_errors .= "<br />Also, failed to roll back transaction. Please contact the system administrator";
}
return array(false, "Failed to assign gameslots for requested games on " . strftime('%c', $datestamp) . ": {$extra_errors}");
}
$rc = $dbh->commit();
if (!$rc) {
return array(false, 'Transaction commit failed');
}
return array(true, '');
}