當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Player::commit方法代碼示例

本文整理匯總了PHP中Player::commit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Player::commit方法的具體用法?PHP Player::commit怎麽用?PHP Player::commit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Player的用法示例。


在下文中一共展示了Player::commit方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: shouldBeAbleToGetAccessToRoles

 public function shouldBeAbleToGetAccessToRoles()
 {
     // given
     $pl = new Player();
     $pl->setFullName("Alf Magne Kalleland");
     $pl->commit();
     // then
     $this->assertFalse($pl->hasAccessTo(ChessRoles::LOGIN));
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:9,代碼來源:PlayerTest.php

示例2: createAdminUser

 private function createAdminUser($details)
 {
     if (isset($details['adminUserName']) && isset($details['adminUserName'])) {
         $pl = new Player();
         $pl->grantAdminAccess();
         $pl->setUsername($details['adminUserName']);
         $pl->setPassword($details['adminPassword']);
         $pl->commit();
         $session = new Session();
         $session->signIn(array('username' => $details['adminUserName'], 'password' => $details['adminPassword'], 'rememberMe' => true));
     }
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:12,代碼來源:ChessDBInstaller.php

示例3: createUser

 public function createUser($username, $password)
 {
     $player = new Player();
     if (!$player->exists()) {
         $player->createTable();
     }
     $player->setUsername($username);
     $player->setPassword($password);
     $player->setEmail('post@dhtmlgoodies.com');
     $player->setOnlinePlayer('1');
     $player->commit();
     return $player;
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:13,代碼來源:ChessTests.php

示例4: getUserWithNonProvisionalElo

 private function getUserWithNonProvisionalElo($eloValue = null)
 {
     $pl = new Player();
     $pl->setUsername(uniqid('user'));
     $pl->setPassword(uniqid('pass'));
     $pl->commit();
     $eloSetter = new EloSetter(1);
     for ($i = 0; $i < 10; $i++) {
         $eloSetter->registerResult($pl, $this->getUserWithElo(1500), 1);
         $eloSetter->registerResult($pl, $this->getUserWithElo(1400), 1);
         $eloSetter->registerResult($pl, $this->getUserWithElo(1200), -1);
         $eloSetter->registerResult($pl, $this->getUserWithElo(2000), 0.5);
     }
     if (isset($eloValue)) {
         $elo = new Elo($pl->getId(), 1);
         $elo->setElo($eloValue);
         $elo->commit();
         return new Player($pl->getId());
     }
     return $pl;
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:21,代碼來源:EloTest.php

示例5: createPlayer

 private function createPlayer()
 {
     $p = new Player();
     $p->setEmail('player@dhtml-chess.com');
     $p->commit();
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:6,代碼來源:PasswordLookupTest.php

示例6: getPlayerIdByName

 private function getPlayerIdByName($name)
 {
     $player = new PlayerByName($name);
     if (!$player->getId()) {
         $p = new Player();
         $p->setFullName($name);
         $p->setOnlinePlayer(0);
         $p->commit();
         return $p->getId();
     }
     return $player->getId();
 }
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:12,代碼來源:Game.php


注:本文中的Player::commit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。