当前位置: 首页>>代码示例>>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;未经允许,请勿转载。