本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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);
}
示例5: testNames
public function testNames()
{
$user = new User();
$first = 'James';
$last = 'Bond';
$user->setFirstName($first);
$user->setLastName($last);
}
示例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;
}