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

findUserByUsernameOrEmail() public method

Find a user by its username or email
public findUserByUsernameOrEmail ( string $usernameOrEmail ) : User
$usernameOrEmail string
return User or null if user does not exist
    function findUserByUsernameOrEmail($usernameOrEmail);

Usage Example

 /**
  * {@inheritDoc}
  */
 public function loadUserByUsername($usernameOrEmail)
 {
     $user = $this->userManager->findUserByUsernameOrEmail($usernameOrEmail);
     if (!$user) {
         throw new UsernameNotFoundException(sprintf('No user with name or email "%s" was found.', $usernameOrEmail));
     }
     return $user;
 }
All Usage Examples Of FOS\UserBundle\Model\UserManagerInterface::findUserByUsernameOrEmail