private function getStoredUserProfile($userId)
    {
        if (is_null($this->_userProfileService)) {
            return null;
        }

        try {
            $userProfileMap = $this->_userProfileService->lookup($userId);
            if (is_null($userProfileMap)) {
                $this->_logger->log(
                    Logger::INFO,
                    sprintf('No user profile found for user with ID "%s".', $userId)
                );
            } elseif (UserProfileUtils::isValidUserProfileMap($userProfileMap)) {
                return UserProfileUtils::convertMapToUserProfile($userProfileMap);
            } else {
                $this->_logger->log(
                    Logger::WARNING,
                    'The User Profile Service returned an invalid user profile map.'
                );
            }
        } catch (Exception $e) {
            $this->_logger->log(
                Logger::ERROR,
                sprintf('The User Profile Service lookup method failed: %s.', $e->getMessage())
            );
        }

        return null;
    }
private function getStoredUserProfile($userId)
    {
        if (is_null($this->_userProfileService)) {
            return null;
        }

        try {
            $userProfileMap = $this->_userProfileService->lookup($userId);
            if (is_null($userProfileMap)) {
                $this->_logger->log(
                    Logger::INFO,
                    sprintf('No user profile found for user with ID "%s".', $userId)
                );
            } elseif (UserProfileUtils::isValidUserProfileMap($userProfileMap)) {
                return UserProfileUtils::convertMapToUserProfile($userProfileMap);
            } else {
                $this->_logger->log(
                    Logger::WARNING,
                    'The User Profile Service returned an invalid user profile map.'
                );
            }
        } catch (Exception $e) {
            $this->_logger->log(
                Logger::ERROR,
                sprintf('The User Profile Service lookup method failed: %s.', $e->getMessage())
            );
        }

        return null;
    }
private function getStoredUserProfile ( $ userId ) { if ( is_null ( $ this -> _userProfileService ) ) { return null ; } try { $ userProfileMap = $ this -> _userProfileService -> lookup ( $ userId ) ; if ( is_null ( $ userProfileMap ) ) { $ this -> _logger -> log ( Logger :: INFO , sprintf ( 'No user profile found for user with ID "%s".' , $ userId ) ) ; } elseif ( UserProfileUtils :: isValidUserProfileMap ( $ userProfileMap ) ) { return UserProfileUtils :: convertMapToUserProfile ( $ userProfileMap ) ; } else { $ this -> _logger -> log ( Logger :: WARNING , 'The User Profile Service returned an invalid user profile map.' ) ; } } catch ( Exception $ e ) { $ this -> _logger -> log ( Logger :: ERROR , sprintf ( 'The User Profile Service lookup method failed: %s.' , $ e -> getMessage ( ) ) ) ; } return null ; }
Get the stored user profile for the given user ID.

@param $userId string the ID of the user.

@return null|UserProfile the stored user profile.
Get the stored user profile for the given user ID .