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