本文整理汇总了PHP中AppBundle\Entity\User::getFirstname方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getFirstname方法的具体用法?PHP User::getFirstname怎么用?PHP User::getFirstname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppBundle\Entity\User
的用法示例。
在下文中一共展示了User::getFirstname方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetFirstname
public function testSetFirstname()
{
// new entity
$user = new User();
// Use the setFirstname method
$user->setFirstname("olsen");
// Assert the result
$this->assertEquals("olsen", $user->getFirstname());
}
示例2: __construct
public function __construct(User $user)
{
$this->id = $user->getId();
$this->firstname = $user->getFirstname();
$this->lastname = $user->getLastname();
$this->email = $user->getEmail();
$this->positionLong = $user->getPositionLong();
$this->positionLat = $user->getPositionLat();
$this->positionCity = $user->getPositionCity();
$this->positionDep = $user->getPositionDep();
$this->positionCountry = $user->getPositionCountry();
$this->photo = $user->getPhoto();
}
示例3: getFirstname
/**
* {@inheritDoc}
*/
public function getFirstname()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getFirstname', []);
return parent::getFirstname();
}
示例4: transform
/**
* Turn this item object into a generic array
*
* @return array
*/
public function transform(User $user)
{
return ['id' => (int) $user->getId(), 'username' => $user->getUsername(), 'email' => $user->getEmail(), 'lastLogin' => $user->getLastLogin(), 'enabled' => (bool) $user->isEnabled(), 'firstname' => $user->getFirstname(), 'lastname' => $user->getLastname(), 'fullname' => $user->getFullname(), 'displayname' => $user->getDisplayName()];
}