当前位置: 首页>>代码示例>>PHP>>正文


PHP Game::getAll方法代码示例

本文整理汇总了PHP中Game::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::getAll方法的具体用法?PHP Game::getAll怎么用?PHP Game::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game的用法示例。


在下文中一共展示了Game::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runLocationSchedule

 protected function runLocationSchedule($nefubId, $date)
 {
     if (is_numeric($nefubId) && $date) {
         if ($oLocation = Location::getByNefubId($nefubId)) {
             $formattedDate = strftime("%A %e %B %Y", strtotime($date));
             $filename = 'agenda ' . $date . ' ' . $oLocation->name;
             $oSeason = Season::getInstance();
             $aGames = Game::getAll(array('date' => $date, 'location_nefub_id' => $oLocation->nefub_id), 'time` ASC, `field', 'asc');
             if (count($aGames)) {
                 $title = 'Programma ' . $formattedDate;
                 $includeField = false;
                 $footer = $title . ' in ' . $oLocation->name . ', ' . $oLocation->city . '. Gedownload van http://' . $_SERVER['HTTP_HOST'] . '/locatie/' . $nefubId;
                 $this->renderGames($filename, $title, $aGames, $footer);
             }
         }
     }
     $this->redirect();
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:18,代码来源:DownloadRenderer.php

示例2: array

    $current_score = $active_players[0]->setScore2(0);
    $current_score = $active_players[0]->getScore2();
    $current_hand = array();
    $draw = array();
    for ($i = 0; $i <= 4; $i++) {
        array_push($current_hand, rand(1, 2));
    }
    for ($z = 0; $z <= 4; $z++) {
        if ($current_hand[0] == $current_hand[1] && $current_hand[0] == $current_hand[2] && $current_hand[0] == $current_hand[3]) {
            $active_players[0]->setScore2($current_score + 1);
        }
    }
    // var_dump($current_hand);
    for ($x = 0; $x <= 4; $x++) {
        if ($current_hand[$x] != $current_hand[1] || $current_hand[$x] != $current_hand[2] || $current_hand[$x] != $current_hand[3] || $current_hand[$x] != $current_hand[4]) {
            $current_hand[$x] = rand(1, 2);
        }
    }
    return $app['twig']->render('player_two_hand.html.twig', array('player_two_cards' => $current_hand, 'games' => $current_players));
});
$app->get('/current_game', function () use($app) {
    $active_game = Game::getAll();
    $active_players = Player::getAll();
    $current_players = $active_players[0]->getPlayers();
    return $app['twig']->render('current_game.html.twig', array('games' => $current_players));
});
$app->get('/restart_game', function () use($app) {
    Game::restartGame();
    return $app['twig']->render('restart_game.html.twig');
});
return $app;
开发者ID:eddieduro,项目名称:go-fish-PHP,代码行数:31,代码来源:app.php

示例3: getFinishedGames

 /**
  * 
  * @return Game[]
  */
 public function getFinishedGames()
 {
     return Game::getAll(array('competition_nefub_id' => $this->nefub_id, 'finished' => 1), 'date` desc, `time', 'desc');
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:8,代码来源:Competition.php

示例4: intval

 $rid = intval($_GPC['rid']);
 if (!empty($rid)) {
     $sql = 'SELECT * FROM ' . tablename('mbrl_records') . ' WHERE `id`=' . $rid;
     $record = pdo_fetch($sql);
     if (empty($record) || $record['activity'] != $activity['actid'] || $record['uid'] != $user['uid']) {
         exit('非法的访问');
     }
     $ret = $record;
 } else {
     if (empty($error)) {
         $g = new Game();
         $filters = array();
         $filters['uid'] = $user['uid'];
         $filters['activity'] = $activity['actid'];
         $filters['status'] = 'paid';
         $trades = $g->getAll($filters);
         if (empty($trades)) {
             exit('没有可用的' . $activity['tag']['label']);
         }
         $ret = $a->grap($user, $activity);
         if (!is_error($ret)) {
             $g->touch($trades[0]['id'], 'completed');
         }
     } else {
         exit($error['message']);
     }
 }
 if (is_error($ret)) {
     exit($ret['message']);
 } elseif ($ret['status'] == 'none') {
     exit('这次游戏没有获得红包, 再来一次 ? ? ?');
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:send.inc.php

示例5: clear_renders

 /**
  * Render all pages so they load fast
  */
 public function clear_renders()
 {
     error_reporting(0);
     self::put("build main page: " . HOST . '/?clear=1');
     get_headers(HOST . '/?clear=1');
     self::put("build calendar " . HOST . '/agenda?clear=1');
     get_headers(HOST . '/agenda?clear=1');
     self::put("build scores " . HOST . '/uitslagen?clear=1');
     get_headers(HOST . '/uitslagen?clear=1');
     self::put("build scores " . HOST . '/uitslagen?clear=1');
     get_headers(HOST . '/speler?clear=1');
     $oSeason = $this->getSeason();
     $aPoules = $oSeason->getPoules();
     foreach ($aPoules as $oPoule) {
         $url = HOST . '/poule/' . $oPoule->nefub_id . '?clear=1';
         self::put("Maak pagina voor poule " . $oPoule->name);
         get_headers($url);
         $aTeams = $oPoule->getPouleTeams();
         foreach ($aTeams as $oPouleTeam) {
             $url = HOST . '/team/' . $oPouleTeam->team_nefub_id . '?clear=1';
             self::put("Maak pagina voor team " . $oPouleTeam->getTeam()->name);
             get_headers($url);
         }
     }
     $aGames = Game::getAll();
     foreach ($aGames as $oGame) {
         $url = HOST . '/wedstrijd/' . $oGame->nefub_id . '?clear=1';
         self::put("Maak pagina voor wedstrijd " . $oGame->nefub_id);
         get_headers($url);
     }
     $this->clearLocationRenders();
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:35,代码来源:Retriever.php

示例6: getFinishedGames

 public function getFinishedGames()
 {
     // The 'or' here means  that it says team1_id = getId() OR team2_id = getId();
     // The relationship between the 'or ...' and finished => 1 is 'AND'
     return Game::getAll(array('or' => array('team1_nefub_id' => $this->nefub_id, 'team2_nefub_id' => $this->nefub_id), 'finished' => 1), 'date', 'DESC');
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:6,代码来源:Team.php


注:本文中的Game::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。