Returns a single user by name.

@param string $username
@return User|null
423797
public function getUser($username)
    {
        $resellers = $this->getUsers();
        return isset($resellers[$username]) ? $resellers[$username] : null;
    }
1043022
protected function getUser()
    {
        if ($this->_user === null) {
            $user = \thienhungho\UserManagement\models\User::findByUsername($this->username);
            $this->_user = $user;
        }

        return $this->_user;
    }
702701
public function getByUsername(string $username)
	{
		return $this->setAuthorizer($this->getModel()->where('username', '=', $username)->first());
	}
344556
public function findByUsername($username)
    {
        $qb = $this->createQueryBuilder("u");
        $qb->where("(u.username = :username OR u.email = :email)")
            ->setParameter("username", $username)
            ->setParameter("email", $username);
        $qb->andWhere("u.status = :status")->setParameter("status", 1);
        $qb->setMaxResults(1);
        return $qb->getQuery()->getOneOrNullResult();
    }
950682
public function getByName($name)
    {
        return isset($this->names[$name]) ? $this->names[$name] : null;
    }
340504
public function getIdFromUsername($username)
    {
        $id = $this->load('uname2uid', $username);

        return ($id === 0) ? null : (int) $id;
    }
1346371
public User getUser(String userName) {
        User result = null;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = item;
            }
        }
        return result;
    }
409867
protected function getUserInfo($username)
    {
        if (!isset(self::$users[$username])) return null;
    
        $user = compact('username') + self::$users[$username];
        unset($user['password']);
        
        return $user;
    }
145321
protected function getUser()
    {
        if ($this->_user === null) {
            $user = $this->module->model('UserIdentity');
            $this->_user = $user::findByUsername($this->username);
        }
        return $this->_user;
    }
1354366
public function findUserByUserName(string $username): User
    {
        foreach ($this->userRepositories as $repository) {
            $user = $repository->findByUsername($username);

            if ($user) {
                return $user;
            }
        }

        throw UserNotFound::withUsername($username);
    }
758455
public function getUserForUsername($username)
    {
        if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username)) {
            return false;
        }
        
        // Get the access entity
        $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username);

        if ($accessEntity === false) {
            return false;
        }
        
        return $accessEntity;
    }
152303
private function getUser($username)
    {
        if (!isset($this->users[strtolower($username)])) {
            $ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
            $ex->setUsername($username);

            throw $ex;
        }

        return $this->users[strtolower($username)];
    }
1368249
public function find($username)
    {
        $parameters['username'] = $username;
        return $this->apiClient->callEndpoint(self::ENDPOINT, $parameters);
    }
131942
private function findUser($username)
    {
        $userManager = $this->getContainer()->get('phlexible_user.user_manager');

        $user = $userManager->find($username);

        if (!$user) {
            $user = $userManager->findByUsername($username);
        }

        if (!$user) {
            return null;
        }

        return $user;
    }
521273
protected function getUserString()
    {
        $user = $this->core->auth()->user();

        if ( ! $user) return null;

        return $user->getUsername();
    }
1247800
public function getToken($username)
	{
		return isset($this->access_tokens[$username]) ? $this->access_tokens[$username] : null;
	}
766810
public static function findByUsername($username)
    {
        foreach (self::$users as $user) {
            if (strcasecmp($user['username'], $username) === 0) {
                return new static($user);
            }
        }

        return null;
    }