DeltaHF
Well-known member
This feels like a really stupid question, but here goes:
My add-on gets a user name from the URL, and I want to convert that to an ID. It seems easy enough, but...
I expected to just use some getUserId() method, but there's not one that I can see. I did find getUserIdFromUser(), but I'm not sure how that is supposed to work.
So...what is the proper way to do this? Do I have to just extend XenForo_Model_User and write my own "getter"?
My add-on gets a user name from the URL, and I want to convert that to an ID. It seems easy enough, but...
PHP:
if (!empty($_GET['username']))
{
$user = $this->getModelFromCache('XenForo_Model_User');
$user->getUserByName($username);
/* OK...now what? */
}
So...what is the proper way to do this? Do I have to just extend XenForo_Model_User and write my own "getter"?
Last edited: