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


PHP User::getName方法代码示例

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


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

示例1: createUserImageResponse

 private function createUserImageResponse(User $user, Image $image)
 {
     return new Response(join(' / ', [$user->getId(), $user->getName(), $image->getId()]), Response::HTTP_OK);
 }
开发者ID:naoyes,项目名称:2015-nov-quartet-tech-blog-paramconverter-sample,代码行数:4,代码来源:DefaultController.php

示例2: getName

 /**
  * {@inheritDoc}
  */
 public function getName()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getName', array());
     return parent::getName();
 }
开发者ID:3lolo,项目名称:lr_app,代码行数:8,代码来源:__CG__AppBundleEntityUser.php

示例3: validateGetGameResponse

 /**
  * @param array $game
  * @param int $gameId
  * @param User $user
  * @param array $playerShips
  * @param User $otherUser
  * @param int $playerNumber
  * @param int $lessThanAgo (in seconds)
  */
 protected function validateGetGameResponse(array $game, $gameId, User $user = null, array $playerShips = [], User $otherUser = null, $playerNumber = 1, $lessThanAgo = 120)
 {
     $expectedKeys = ['id', 'playerShips', 'playerNumber', 'timestamp'];
     if ($user) {
         $expectedKeys[] = 'player';
     }
     if ($otherUser) {
         $expectedKeys[] = 'other';
     }
     $gameKeys = array_keys($game);
     sort($expectedKeys);
     sort($gameKeys);
     $this->assertEquals($expectedKeys, $gameKeys);
     $this->assertEquals($gameId, $game['id'], 'Incorrect game id');
     if ($user) {
         $this->assertEquals(['name' => $user->getName()], $game['player'], 'Incorrect player details');
     }
     $this->assertEquals($playerShips, $game['playerShips'], 'Incorrect player ships');
     $this->assertEquals($playerNumber, $game['playerNumber'], 'Incorrect player number');
     if ($otherUser) {
         $this->assertEquals(['name' => $otherUser->getName()], $game['other'], 'Incorrect other details');
     }
     // not more than X seconds ago
     $timestamp = new \DateTime($game['timestamp']);
     $this->assertLessThan($lessThanAgo, time() - $timestamp->getTimestamp());
 }
开发者ID:jlekowski,项目名称:battleships-api,代码行数:35,代码来源:GameControllerTest.php


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