- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicatebankdetailcriterion.php
- Класс: Bitrix\Crm\Integrity\DuplicateBankDetailCriterion
- Вызов: DuplicateBankDetailCriterion::unregister
static function unregister($entityTypeID, $entityID, $countryId = 0, $fieldName = '')
{
if(!is_int($entityTypeID))
{
throw new Main\ArgumentTypeException('entityTypeID', 'integer');
}
if(!is_int($entityID))
{
throw new Main\ArgumentTypeException('entityID', 'integer');
}
if(!is_int($countryId))
{
throw new Main\ArgumentTypeException('countryId', 'integer');
}
if(!is_string($fieldName))
{
throw new Main\ArgumentTypeException('fieldName', 'string');
}
$filter = array(
'ENTITY_TYPE_ID' => $entityTypeID,
'ENTITY_ID' => $entityID
);
$scope = null;
if($countryId > 0)
{
$filter['BD_COUNTRY_ID'] = $countryId;
$scope = EntityBankDetail::formatDuplicateCriterionScope($countryId);
}
if($fieldName !== '')
{
$filter['BD_FIELD_NAME'] = $fieldName;
}
$dbResult = DuplicateBankDetailMatchCodeTable::getList(
array(
'select' =>array('ID'),
'order' => array('ID' =>'ASC'),
'filter' => $filter
)
);
while($fields = $dbResult->fetch())
{
DuplicateBankDetailMatchCodeTable::delete($fields['ID']);
}
$typeId = DuplicateIndexType::resolveID($fieldName);
if(in_array($typeId, self::getSupportedDedupeTypes(), true))
{
DuplicateEntityMatchHash::unregisterEntity($entityTypeID, $entityID, $typeId, $scope);
}
elseif($fieldName === '')
{
foreach (self::getSupportedDedupeTypes() as $typeId)
{
DuplicateEntityMatchHash::unregisterEntity($entityTypeID, $entityID, $typeId, $scope);
}
}
}