- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicatevolatilecriterion.php
- Класс: Bitrix\Crm\Integrity\DuplicateVolatileCriterion
- Вызов: DuplicateVolatileCriterion::register
static function register(
int $entityTypeId,
int $entityId,
array $fieldCategoryIds = [],
array $volatileTypes = []
)
{
if ($entityTypeId === CCrmOwnerType::BankDetail)
{
[$entityTypeId, $entityId] = array_values(
EntityBankDetail::getSingleInstance()->getOwnerEntityById($entityId)
);
}
if ($entityTypeId === CCrmOwnerType::Requisite)
{
[$entityTypeId, $entityId] = array_values(
EntityRequisite::getSingleInstance()->getOwnerEntityById($entityId)
);
}
if (
(
$entityTypeId === CCrmOwnerType::Lead
|| $entityTypeId === CCrmOwnerType::Company
|| $entityTypeId === CCrmOwnerType::Contact
)
&& $entityId > 0
)
{
$volatileTypeIds =
empty($volatileTypes)
? static::getAllSupportedDedupeTypes()
: static::filterValidTypes($volatileTypes)
;
foreach ($volatileTypeIds as $volatileTypeId)
{
$criterion = new static($volatileTypeId);
if (
!$criterion->isNull()
&& $entityTypeId === $criterion->getEntityTypeId()
&& (
empty($fieldCategoryIds)
|| in_array($criterion->getFieldCategoryId(), $fieldCategoryIds, true)
)
)
{
$criterion->registerByEntityId($entityId);
}
}
}
}