• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Using XenForo_Model_User functions in static function?

#1
hey,

I have an cron job which requires a static method but I would like to use the XenForo_Model_User functions there to get the user by id.

Is there any way to do that or would I need to create my own query to get the user?
 

Chris D

XenForo developer
Staff member
#2
Shouldn't be a problem. You can instantiate the user model like this:
PHP:
$userModel = XenForo_Model::create('XenForo_Model_User');