public function getUser($userId)
    {
        // Make sure users have been 'got' already.
        $this->getUsers();

        // In most cases by far, we'll request an ID, and we can return it here.
        if ($userId && array_key_exists($userId, $this->users)) {
            return $this->users[$userId];
        }

        // Fallback: See if we can get it by username or email address.
        try {
            if ($userEntity = $this->getRepository()->getUser($userId)) {
                return $userEntity->toArray();
            }
        } catch (TableNotFoundException $e) {
            return false;
        }

        return false;
    }
public function getUser($userId)
    {
        // Make sure users have been 'got' already.
        $this->getUsers();

        // In most cases by far, we'll request an ID, and we can return it here.
        if ($userId && array_key_exists($userId, $this->users)) {
            return $this->users[$userId];
        }

        // Fallback: See if we can get it by username or email address.
        try {
            if ($userEntity = $this->getRepository()->getUser($userId)) {
                return $userEntity->toArray();
            }
        } catch (TableNotFoundException $e) {
            return false;
        }

        return false;
    }
public function getUser ( $ userId ) { // Make sure users have been 'got' already. $ this -> getUsers ( ) ; // In most cases by far, we'll request an ID, and we can return it here. if ( $ userId && array_key_exists ( $ userId , $ this -> users ) ) { return $ this -> users [ $ userId ] ; } // Fallback: See if we can get it by username or email address. try { if ( $ userEntity = $ this -> getRepository ( ) -> getUser ( $ userId ) ) { return $ userEntity -> toArray ( ) ; } } catch ( TableNotFoundException $ e ) { return false ; } return false ; }
Get a user, specified by ID, username or email address.

@param int|string $userId

@return array|false
Get a user specified by ID username or email address .