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


PHP Game::getId方法代码示例

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


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

示例1: executeCreate

 public function executeCreate(sfWebRequest $request)
 {
     $user = UserPeer::retrieveByPk($request->getParameter('username'));
     if (!$user) {
         $arr = array();
         $arr["result"] = false;
         $arr["message"] = "Invalid username";
         $this->renderText(json_encode($arr));
         return sfView::NONE;
     }
     $game = new Game();
     $game->setIsPublic($request->getParameter('public', 0));
     $game->setStartTime(time());
     $game->setIsActive(true);
     $game->setLatitude($request->getParameter('latitude'));
     $game->setLongitude($request->getParameter('longitude'));
     $game->save();
     $gameMember = new GameMember();
     $gameMember->setUserId($user->getId());
     $gameMember->setGameId($game->getId());
     $gameMember->setIsActive(true);
     $gameMember->save();
     $user->setCurrentGameId($game->getId());
     $this->updateUserLocation($user, $request);
     $arr = array();
     $arr["result"] = true;
     $arr["message"] = "Game created, game number is " . $game->getId() . ".  When others join, you will be assigned a target";
     $this->renderText(json_encode($arr));
     return sfView::NONE;
 }
开发者ID:adatta02,项目名称:comp194ma,代码行数:30,代码来源:actions.class.php

示例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));
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:30,代码来源:ScheduleDocx.php

示例3: setGame

 /**
  * Declares an association between this object and a Game object.
  *
  * @param      Game $v
  * @return     User The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setGame(Game $v = null)
 {
     if ($v === null) {
         $this->setCurrentGameId(NULL);
     } else {
         $this->setCurrentGameId($v->getId());
     }
     $this->aGame = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Game object, it will not be re-added.
     if ($v !== null) {
         $v->addUser($this);
     }
     return $this;
 }
开发者ID:adatta02,项目名称:comp194ma,代码行数:22,代码来源:BaseUser.php

示例4: createGameMetadata

 private function createGameMetadata($gameId, $key, $value)
 {
     // given
     $game = new Game($gameId);
     if (!$game->getId()) {
         $game->setValues(array("id", $gameId, "white" => "Alf"));
         $game->commit();
     }
     $m = new MetadataValue($key);
     // when
     $m->setGameid($gameId);
     $m->setMetadataKey($key);
     $m->setMetadataValue($value);
     $m->commit();
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:15,代码来源:MetadataTest.php

示例5: importGame

 private function importGame($game, $intoDb = null)
 {
     $game['database_id'] = $intoDb;
     $g = new Game();
     $g->save($game);
     return $g->getId();
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:7,代码来源:GameImport.php

示例6: Game

<?php

require_once './class/Game.class.php';
session_start();
if (count($_SESSION) == 0) {
    $game = new Game();
    $_SESSION['party_id'] = $game->getId();
    $game->save();
} else {
    header('Location: game.php');
}
开发者ID:vmarchaud,项目名称:42_workspace,代码行数:11,代码来源:index.php

示例7: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Game $value A Game object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Game $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:adatta02,项目名称:comp194ma,代码行数:22,代码来源:BaseGamePeer.php

示例8: getGameWithAMove

 private function getGameWithAMove()
 {
     $game = new Game();
     $game->appendMove('e4');
     return $game->getId();
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:6,代码来源:GameTest.php


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