当前位置: 首页>>代码示例>>PHP>>正文


PHP UserManagerInterface::refreshUser方法代码示例

本文整理汇总了PHP中FOS\UserBundle\Model\UserManagerInterface::refreshUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManagerInterface::refreshUser方法的具体用法?PHP UserManagerInterface::refreshUser怎么用?PHP UserManagerInterface::refreshUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FOS\UserBundle\Model\UserManagerInterface的用法示例。


在下文中一共展示了UserManagerInterface::refreshUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: refreshUser

 /**
  * {@inheritDoc}
  */
 public function refreshUser(UserInterface $user)
 {
     // Compatibility with FOSUserBundle < 2.0
     if (class_exists('FOS\\UserBundle\\Form\\Handler\\RegistrationFormHandler')) {
         return $this->userManager->refreshUser($user);
     }
     if (!$user instanceof User) {
         throw new UnsupportedUserException(sprintf('Expected an instance of FOS\\UserBundle\\Model\\User, but got "%s".', get_class($user)));
     }
     if (null === ($reloadedUser = $this->userManager->findUserBy(array('id' => $user->getId())))) {
         throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $user->getId()));
     }
     return $user;
 }
开发者ID:michaeljayt,项目名称:HWIOAuthBundle,代码行数:17,代码来源:FOSUBUserProvider.php

示例2: refreshUser

 /**
  * {@inheritDoc}
  */
 public function refreshUser(UserInterface $user)
 {
     // Compatibility with FOSUserBundle < 2.0
     if (class_exists('FOS\\UserBundle\\Form\\Handler\\RegistrationFormHandler')) {
         return $this->userManager->refreshUser($user);
     }
     $identifier = $this->properties['identifier'];
     if (!$user instanceof User || !$this->accessor->isReadable($user, $identifier)) {
         throw new UnsupportedUserException(sprintf('Expected an instance of FOS\\UserBundle\\Model\\User, but got "%s".', get_class($user)));
     }
     $userId = $this->accessor->getValue($user, $identifier);
     if (null === ($user = $this->userManager->findUserBy(array($identifier => $userId)))) {
         throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $userId));
     }
     return $user;
 }
开发者ID:Aukraiser,项目名称:YetAnotherTweetsAnalyzer,代码行数:19,代码来源:FOSUBUserProvider.php

示例3: refreshUser

 /**
  * {@inheritDoc}
  */
 public function refreshUser(UserInterface $user)
 {
     return $this->userManager->refreshUser($user);
 }
开发者ID:enriquesomolinos,项目名称:packagist,代码行数:7,代码来源:UserProvider.php


注:本文中的FOS\UserBundle\Model\UserManagerInterface::refreshUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。