Answer the question
In order to leave comments, you need to log in
How to get username or fullname of user by modx revo api phone number?
Hello.
I'm trying to find a username (preferably) or at least a user's fullname by phone number,
$tell = $_POST['tell'];
//найти юзера по номеру телефона
if ($profile = $modx->getObject('modUserProfile', ['mobilephone' => $tell])) {
$getUser = $profile->getOne('User');
//номер телефона в системе находится
$userName = ""; // а вот как теперь в профиле, в котором нашелся номер телефона, получить username/fullname?
Answer the question
In order to leave comments, you need to log in
Doper himself, everything turned out to be simple$userName = $getUser->get('username');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question