Assert Valid User in Model?

Jaxel

Well-known member
I am doing a comment system... and I want to be able to check if a commenter's account exists...
Code:
$comment['userValid'] = $this->getHelper('UserProfile')->assertUserProfileValidAndViewable($comment['user_id']);

This code does not work because getHelper is not valid in models. Is there an alternative?
 
I doubt that there is a good way to use code from helper as it throws an exception in case of error instead returning a value. You can however call the methods this helper calls (XenForo_Model_User::getFullUserById and XenForo_Model_UserProfile::canViewFullUserProfile) directly from your model.
 
Top Bottom