• Модуль: messageservice
  • Путь к файлу: ~/bitrix/modules/messageservice/lib/Restriction/RestrictionManager.php
  • Класс: BitrixMessageServiceRestrictionRestrictionManager
  • Вызов: RestrictionManager::registerRestrictions
private function registerRestrictions(Message $message): array
{
	//TODO Put it in configs
	/** @var Base[] $restrictions */
	$restrictions = [
		new SmsPerUser($message),
		new SmsPerPhone($message),
		new PhonePerUser($message),
		new UserPerPhone($message),
		new IpPerUser($message),
		new IpPerPhone($message)
	];

	$result = [];
	foreach($restrictions as $restriction)
	{
		if ($restriction->canUse())
		{
			$result[$restriction->getEntityId()] = $restriction;
		}
	}

	return $result;
}