當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。