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

	$entitiesToMatch = $this->getEntitiesToMatch();
	$existingEntities = $this->loadExistingEntities();

	foreach ($entitiesToMatch as $entityToMatch)
	{
		if (!empty($existingEntities))
		{
			$matchedEntity = $this->matchEntity($entityToMatch, $existingEntities);
		}

		if (empty($matchedEntity))
		{
			$matchedEntity = $this->addEntity($entityToMatch);
		}

		if (!empty($matchedEntity))
		{
			$matched[] = $matchedEntity;
		}
	}

	return $matched;
}