• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/recipient/type.php
  • Класс: BitrixSenderRecipientType
  • Вызов: Type::detect
static function detect($recipientCode, $isNormalized = false)
{
	$list = self::getNamedList();
	unset($list[self::PHONE]);
	$list = array_keys($list);
	$list[] = self::PHONE;

	foreach ($list as $id)
	{
		if ($isNormalized)
		{
			$normalizedCode = $recipientCode;
		}
		else
		{
			$normalizedCode = Normalizer::normalize($recipientCode, $id);
		}

		if (!Validator::validate($normalizedCode, $id))
		{
			continue;
		}

		return $id;
	}

	return null;
}