• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_phone.php
  • Класс: CVoxImplantPhone
  • Вызов: CVoxImplantPhone::GetUserPhone
static function GetUserPhone($userId)
{
	$userRecord = BitrixMainUserTable::getRow([
		'select' => ['WORK_PHONE', 'PERSONAL_PHONE', 'PERSONAL_MOBILE'],
		'filter' => ['=ID' => $userId]
	]);
	if (!is_array($userRecord))
	{
		return false;
	}
	foreach ($userRecord as $key => $value)
	{
		$userRecord[$key] = CVoxImplantPhone::stripLetters($value);
	}
	if ($userRecord['PERSONAL_MOBILE'] != '')
	{
		return $userRecord['PERSONAL_MOBILE'];
	}
	if ($userRecord['PERSONAL_PHONE'] != '')
	{
		return $userRecord['PERSONAL_PHONE'];
	}
	if ($userRecord['WORK_PHONE'] != '')
	{
		return $userRecord['WORK_PHONE'];
	}

	return false;
}