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


PHP User::setLastName方法代碼示例

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


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

示例1: userFullNameRetrieves

 /**
  * @test
  */
 public function userFullNameRetrieves()
 {
     $firstname = 'First';
     $lastname = 'Last';
     $user = new User();
     $user->setFirstName($firstname);
     $user->setLastName($lastname);
     $worklog = new Worklog(new TimeSpent(50), new \DateTime('now'), new Task(), $user, 'DUMMY_DESCRIPTION');
     $this->assertEquals(sprintf('%s %s', $firstname, $lastname), $worklog->getUserFullName());
 }
開發者ID:vdrizheruk,項目名稱:OroCrmTimeLapBundle,代碼行數:13,代碼來源:WorklogTest.php

示例2: denormalizeShort

 /**
  * Short mode denormalization
  *
  * @param mixed $data
  * @param string $class
  * @param mixed $format
  * @param array $context
  * @return User
  */
 protected function denormalizeShort($data, $class, $format = null, array $context = array())
 {
     $result = new User();
     if (!empty($data['username'])) {
         $result->setUsername($data['username']);
     }
     if (!empty($data['fullName'])) {
         list($firstName, $lastName) = explode(' ', $data['fullName'], 2);
         $result->setFirstName($firstName);
         $result->setLastName($lastName);
     }
     return $result;
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:22,代碼來源:UserNormalizer.php

示例3: createUser

 /**
  * @param string $firstName
  * @param string $lastName
  *
  * @return User
  */
 protected function createUser($firstName, $lastName)
 {
     $user = new User();
     $user->setOrganization($this->organization);
     $user->setFirstName($firstName);
     $user->setLastName($lastName);
     $user->setUsername(strtolower($firstName . '.' . $lastName));
     $user->setPassword(strtolower($firstName . '.' . $lastName));
     $user->setEmail(strtolower($firstName . '_' . $lastName . '@example.com'));
     $user->addEmail($this->email);
     $this->em->persist($user);
     return $user;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:19,代碼來源:LoadEmailSuggestionData.php

示例4: testGetVariableValues

 public function testGetVariableValues()
 {
     $organization = new Organization();
     $organization->setName('TestOrg');
     $user = new User();
     $user->setUsername('test');
     $user->setFirstName('FirstName');
     $user->setLastName('LastName');
     $this->securityFacade->expects($this->once())->method('getOrganization')->will($this->returnValue($organization));
     $this->securityFacade->expects($this->once())->method('getLoggedUser')->will($this->returnValue($user));
     $this->nameFormatter->expects($this->once())->method('format')->with($this->identicalTo($user))->will($this->returnValue('FullName'));
     $result = $this->provider->getVariableValues();
     $this->assertEquals(['userName' => 'test', 'userFirstName' => 'FirstName', 'userLastName' => 'LastName', 'userFullName' => 'FullName', 'organizationName' => 'TestOrg'], $result);
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:14,代碼來源:LoggedUserVariablesProviderTest.php

示例5: testNames

 public function testNames()
 {
     $user = new User();
     $first = 'James';
     $last = 'Bond';
     $user->setFirstName($first);
     $user->setLastName($last);
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:8,代碼來源:UserTest.php

示例6: getOroUsersCollection

 /**
  * @param int $size
  * @param string $specificData
  * @return array
  */
 protected function getOroUsersCollection($size = 2, $specificData = '')
 {
     $result = array();
     for ($i = 0; $i < $size; $i++) {
         $user = new OroUser();
         $user->setUsername("username_{$i}");
         $user->setFirstName("First {$specificData}");
         $user->setLastName("Last {$specificData}");
         $user->setEmail("some@host{$i}.com");
         $result[] = $user;
     }
     return $result;
 }
開發者ID:northdakota,項目名稱:diamantedesk-application,代碼行數:18,代碼來源:DiamanteUserSearchHandlerTest.php


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