src/CRUDlex/UserProvider.php
public function loadUserByUsername($username)
    {

        $users = $this->userData->listEntries([$this->usernameField => $username], [$this->usernameField => '='], 0, 1);
        if (count($users) === 0) {
            throw new UsernameNotFoundException();
        }

        $user = $users[0];
        $roles = is_string($this->userRoleIdentifier) ? $this->loadUserRolesViaManyToMany($user) : $this->loadUserRolesViaData($user->get('id'));

        $userObj = new User($this->usernameField, $this->passwordField, $this->saltField, $user, $roles);
        return $userObj;
    }
public function loadUserByUsername($username)
    {

        $users = $this->userData->listEntries([$this->usernameField => $username], [$this->usernameField => '='], 0, 1);
        if (count($users) === 0) {
            throw new UsernameNotFoundException();
        }

        $user = $users[0];
        $roles = is_string($this->userRoleIdentifier) ? $this->loadUserRolesViaManyToMany($user) : $this->loadUserRolesViaData($user->get('id'));

        $userObj = new User($this->usernameField, $this->passwordField, $this->saltField, $user, $roles);
        return $userObj;
    }
public function loadUserByUsername ( $ username ) { $ users = $ this -> userData -> listEntries ( [ $ this -> usernameField => $ username ] , [ $ this -> usernameField => '=' ] , 0 , 1 ) ; if ( count ( $ users ) === 0 ) { throw new UsernameNotFoundException ( ) ; } $ user = $ users [ 0 ] ; $ roles = is_string ( $ this -> userRoleIdentifier ) ? $ this -> loadUserRolesViaManyToMany ( $ user ) : $ this -> loadUserRolesViaData ( $ user -> get ( 'id' ) ) ; $ userObj = new User ( $ this -> usernameField , $ this -> passwordField , $ this -> saltField , $ user , $ roles ) ; return $ userObj ; }
Loads and returns an user by username.
Throws an UsernameNotFoundException on not existing username.

@param string $username
the username

@return User
the loaded user
Loads and returns an user by username . Throws an UsernameNotFoundException on not existing username .