src/Sulu/Bundle/SecurityBundle/UserManager/UserManager.php
public function isUsernameUnique($username)
    {
        if ($username) {
            try {
                $this->userRepository->findUserByUsername($username);
            } catch (NoResultException $exc) {
                return true;
            }
        }

        return false;
    }
public function isUsernameUnique($username)
    {
        if ($username) {
            try {
                $this->userRepository->findUserByUsername($username);
            } catch (NoResultException $exc) {
                return true;
            }
        }

        return false;
    }
public function isUsernameUnique ( $ username ) { if ( $ username ) { try { $ this -> userRepository -> findUserByUsername ( $ username ) ; } catch ( NoResultException $ exc ) { return true ; } } return false ; }
Checks if a username is unique
Null and empty will always return false.

@param string $username

@return bool
Checks if a username is unique Null and empty will always return false .