DuplicateIndexBuilder::isExists

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. DuplicateIndexBuilder
  4. isExists
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicateindexbuilder.php
  • Класс: Bitrix\Crm\Integrity\DuplicateIndexBuilder
  • Вызов: DuplicateIndexBuilder::isExists
public function isExists()
{
	$params = array(
		'TYPE_ID' => $this->typeID,
		'ENTITY_TYPE_ID' => $this->getEntityTypeID(),
		'USER_ID' => $this->getUserID()
	);

	if($this->typeID === DuplicateIndexType::PERSON)
	{
		return DuplicatePersonCriterion::checkIndex($params);
	}
	elseif($this->typeID === DuplicateIndexType::ORGANIZATION)
	{
		return DuplicateOrganizationCriterion::checkIndex($params);
	}
	elseif($this->typeID === DuplicateIndexType::COMMUNICATION_PHONE
		|| $this->typeID === DuplicateIndexType::COMMUNICATION_EMAIL)
	{
		return DuplicateCommunicationCriterion::checkIndex($params);
	}
	elseif(($this->typeID & DuplicateIndexType::REQUISITE) === $this->typeID)
	{
		return DuplicateRequisiteCriterion::checkIndex($params);
	}
	elseif(($this->typeID & DuplicateIndexType::BANK_DETAIL) === $this->typeID)
	{
		return DuplicateBankDetailCriterion::checkIndex($params);
	}

	foreach (DuplicateVolatileCriterion::getSupportedDedupeTypes() as $currentTypeId)
	{
		if ((($this->typeID & $currentTypeId) === $currentTypeId))
		{
			return DuplicateVolatileCriterion::checkIndex($params);
		}
	}

	throw new Main\NotSupportedException(
		"Criterion type(s): '"
		. DuplicateIndexType::resolveName($this->typeID)
		. "' is not supported in current context"
	);
}

Добавить комментарий