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

	if (!\CCrmOwnerType::IsDefined($entityTypeID))
	{
		throw new Main\ArgumentException('The parameter "entityTypeID" has invalid value.');
	}

	if(!is_int($entityID))
	{
		throw new Main\ArgumentTypeException('entityID', 'integer');
	}

	if ($entityID <= 0)
	{
		throw new Main\ArgumentException('The parameter "entityID" has invalid value.');
	}

	$requisites = self::prepareEntityRequisiteValues($entityTypeID, $entityID);
	self::bulkRegister(
		$entityTypeID,
		$entityID,
		self::prepareBulkData($requisites)
	);

}