• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicatecontrol.php
  • Класс: Bitrix\Crm\Integrity\DuplicateControl
  • Вызов: DuplicateControl::enabledFor
public function enabledFor($entityTypeID, $enable)
{
	if(!is_int($entityTypeID))
	{
		throw new Main\ArgumentTypeException('entityTypeID', 'integer');
	}

	if(!\CCrmOwnerType::IsDefined($entityTypeID))
	{
		throw new Main\NotSupportedException("Entity ID: '{$entityTypeID}' is not supported in current context");
	}

	if(!is_bool($enable))
	{
		if(is_numeric($enable))
		{
			$enable = $enable > 0;
		}
		elseif(is_string($enable))
		{
			$enable = mb_strtoupper($enable) === 'Y';
		}
		else
		{
			$enable = false;
		}
	}
	$this->settings['enableFor'][\CCrmOwnerType::ResolveName($entityTypeID)] = $enable ? 'Y' : 'N';
}