protected function getUserEntity($userName)
    {
        if (!$userEntity = $this->getRepositoryUsers()->getUser($userName)) {
            $this->flashLogger->error(Trans::__('general.phrase.error-user-name-password-incorrect'));

            return null;
        }

        if (!$userEntity->getEnabled()) {
            $this->systemLogger->alert("Attempt to login with disabled account by '$userName'", ['event' => 'security']);
            $this->flashLogger->error(Trans::__('general.phrase.login-account-disabled'));

            return null;
        }

        return $userEntity;
    }
protected function getUserEntity($userName)
    {
        if (!$userEntity = $this->getRepositoryUsers()->getUser($userName)) {
            $this->flashLogger->error(Trans::__('general.phrase.error-user-name-password-incorrect'));

            return null;
        }

        if (!$userEntity->getEnabled()) {
            $this->systemLogger->alert("Attempt to login with disabled account by '$userName'", ['event' => 'security']);
            $this->flashLogger->error(Trans::__('general.phrase.login-account-disabled'));

            return null;
        }

        return $userEntity;
    }
protected function getUserEntity ( $ userName ) { if ( ! $ userEntity = $ this -> getRepositoryUsers ( ) -> getUser ( $ userName ) ) { $ this -> flashLogger -> error ( Trans :: __ ( 'general.phrase.error-user-name-password-incorrect' ) ) ; return null ; } if ( ! $ userEntity -> getEnabled ( ) ) { $ this -> systemLogger -> alert ( "Attempt to login with disabled account by '$userName'" , [ 'event' => 'security' ] ) ; $ this -> flashLogger -> error ( Trans :: __ ( 'general.phrase.login-account-disabled' ) ) ; return null ; } return $ userEntity ; }
Get the user record entity if it exists.

@param string $userName

@return Entity\Users|null
Get the user record entity if it exists .