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


PHP User::getFirstName方法代码示例

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


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

示例1: transform

 /**
  * Transform a Model User to its representation.
  *
  * @param User|null $user
  *
  * @return UserRepresentation|null
  */
 public function transform($user)
 {
     if (!$user) {
         return;
     }
     $representation = new UserRepresentation();
     $representation->setId($user->getId());
     $representation->setUsername($user->getUsername());
     $representation->setEmail($user->getEmail());
     $representation->setFirstname($user->getFirstName());
     return $representation;
 }
开发者ID:bamlab,项目名称:Versioned-API-Tuto,代码行数:19,代码来源:UserTransformer.php

示例2: getFirstName

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

示例3: entityToWebHomeUser

 /**
  * @param User $user
  *
  * @return WebHomeUser
  */
 public function entityToWebHomeUser(User $user)
 {
     $model = new WebHomeUser($user->getUsername(), '', $user->getFirstName(), $user->getLastName(), $user->getLocale(), $user->getAccessTokens()->last()->getToken(), '');
     return $model;
 }
开发者ID:nicolasdewez,项目名称:webhome-auth,代码行数:10,代码来源:UserTransformer.php

示例4: assertIsValidV2Response

 /**
  * Test is the given response is valid.
  *
  * @param Response $response
  * @param User     $user
  */
 private function assertIsValidV2Response(Response $response, User $user)
 {
     // Response is OK
     $this->assertEquals(200, $response->getStatusCode());
     $result = $response->getContent();
     $content = json_decode($result, true);
     // All key are presents
     $keys = array('id', 'username', 'email', 'firstname');
     foreach ($keys as $key) {
         $this->assertArrayHasKey($key, $content);
     }
     // There is no extra key
     foreach ($content as $key => $value) {
         $this->assertContains($key, $keys);
     }
     // all values are valid
     $this->assertEquals($user->getId(), $content['id']);
     $this->assertEquals($user->getUsername(), $content['username']);
     $this->assertEquals($user->getEmail(), $content['email']);
     $this->assertEquals($user->getFirstName(), $content['firstname']);
 }
开发者ID:bamlab,项目名称:Versioned-API-Tuto,代码行数:27,代码来源:UserControllerTest.php


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