• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/entity/duplicateindexmismatch.php
  • Класс: Bitrix\Crm\Integrity\Entity\DuplicateIndexMismatchTable
  • Вызов: DuplicateIndexMismatchTable::deleteByEntity
static function deleteByEntity($entityTypeID, $entityID)
{
	if(!is_int($entityTypeID))
	{
		$entityTypeID = (int)$entityTypeID;
	}
	if(!\CCrmOwnerType::IsDefined($entityTypeID))
	{
		throw new Main\ArgumentException("Is not defined or invalid", 'entityTypeID');
	}

	if(!is_int($entityID))
	{
		$entityID = (int)$entityID;
	}
	if($entityID <= 0)
	{
		throw new Main\ArgumentException("Must be greater than zero", 'entityID');
	}

	$connection = Main\Application::getConnection();
	$connection->queryExecute(
		"DELETE FROM b_crm_dp_index_mismatch WHERE ENTITY_TYPE_ID = {$entityTypeID} AND L_ENTITY_ID = {$entityID}"
	);
	$connection->queryExecute(
		"DELETE FROM b_crm_dp_index_mismatch WHERE ENTITY_TYPE_ID = {$entityTypeID} AND R_ENTITY_ID = {$entityID}"
	);
}