S
S
Sergey Miller2020-08-12 17:36:25
MODX
Sergey Miller, 2020-08-12 17:36:25

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

1 answer(s)
S
Sergey Miller, 2020-08-12
@blackseabreathe

Doper himself, everything turned out to be simple$userName = $getUser->get('username');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question