FOS\UserBundle\Model\UserManagerInterface::findUserBy PHP Method

findUserBy() public method

Finds one user by the given criteria
public findUserBy ( array $criteria ) : User
$criteria array
return User
    function findUserBy(array $criteria);

Usage Example

 /**
  * {@inheritDoc}
  */
 public function refreshUser(SecurityUserInterface $user)
 {
     if (!$user instanceof User && !$user instanceof PropelUser) {
         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 $reloadedUser;
 }
All Usage Examples Of FOS\UserBundle\Model\UserManagerInterface::findUserBy