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


PHP User::getUsername方法代碼示例

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


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

示例1: normalizeShort

 /**
  * Short mode normalization
  *
  * @param User $object
  * @param mixed $format
  * @param array $context
  * @return array
  */
 protected function normalizeShort($object, $format = null, array $context = array())
 {
     $firstName = $object->getFirstName();
     $lastName = $object->getLastName();
     $fullName = null;
     if ($firstName || $lastName) {
         $fullName = trim(sprintf('%s %s', $object->getFirstName(), $object->getLastName()));
     }
     return array('username' => $object->getUsername(), 'fullName' => $fullName);
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:18,代碼來源:UserNormalizer.php

示例2: setSecurityContext

 /**
  * @param User $user
  */
 protected function setSecurityContext($user)
 {
     $securityContext = $this->container->get('security.context');
     $token = new UsernamePasswordOrganizationToken($user, $user->getUsername(), 'main', $this->getReference('default_organization'));
     $securityContext->setToken($token);
 }
開發者ID:rodolfobandeira,項目名稱:crm,代碼行數:9,代碼來源:LoadEmailData.php

示例3: convertEvent

 /**
  * @param User $user
  *
  * @return string
  */
 public function convertEvent(User $user)
 {
     return $user->getUsername();
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:9,代碼來源:CalendarEventInviteesTypeTest.php

示例4: testUnserialize

 public function testUnserialize()
 {
     $user = new User();
     $serialized = array('password', 'salt', 'username', true, 'confirmation_token', 10);
     $user->unserialize(serialize($serialized));
     $this->assertEquals($serialized[0], $user->getPassword());
     $this->assertEquals($serialized[1], $user->getSalt());
     $this->assertEquals($serialized[2], $user->getUsername());
     $this->assertEquals($serialized[3], $user->isEnabled());
     $this->assertEquals($serialized[4], $user->getConfirmationToken());
     $this->assertEquals($serialized[5], $user->getId());
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:12,代碼來源:UserTest.php

示例5: setSecurityContext

 /**
  * @param User $user
  */
 protected function setSecurityContext(User $user)
 {
     $token = new UsernamePasswordOrganizationToken($user, $user->getUsername(), 'main', $this->organization);
     $this->securityContext->setToken($token);
 }
開發者ID:antrampa,項目名稱:crm,代碼行數:8,代碼來源:LoadUsersCalendarData.php

示例6: setSecurityContext

 /**
  * @param User         $user
  * @param Organization $organization|null
  */
 protected function setSecurityContext(User $user, Organization $organization = null)
 {
     $securityContext = $this->container->get('security.context');
     if ($organization) {
         $token = new UsernamePasswordOrganizationToken($user, $user->getUsername(), 'main', $organization);
     } else {
         $token = new UsernamePasswordToken($user, $user->getUsername(), 'main');
     }
     $securityContext->setToken($token);
 }
開發者ID:snorchel,項目名稱:platform,代碼行數:14,代碼來源:AddActivityListsData.php


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