• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/matcher/baseentitymatcher.php
  • Класс: Bitrix\Crm\Order\Matcher\BaseEntityMatcher
  • Вызов: BaseEntityMatcher::match
public function match()
{
	$entityId = null;

	if ($this->isDuplicateControlEnabled())
	{
		$duplicateId = $this->search();

		if (!empty($duplicateId) && $this->update($duplicateId))
		{
			$entityId = $duplicateId;
		}
	}

	if (empty($entityId))
	{
		$entityId = $this->create();
	}

	return $entityId ? $entityId : null;
}