• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicatebankdetailcriterion.php
  • Класс: Bitrix\Crm\Integrity\DuplicateBankDetailCriterion
  • Вызов: DuplicateBankDetailCriterion::getIndexedFieldsMap
static function getIndexedFieldsMap($entityTypeID = \CCrmOwnerType::Undefined, $byScope = false)
{
	$result = array();

	if(!is_int($entityTypeID))
	{
		throw new Main\ArgumentTypeException('entityTypeID', 'integer');
	}

	$fieldsMap = self::getFieldsMap();

	$indexedFieldsMap = array();
	foreach (DuplicateBankDetailMatchCodeTable::getIndexedFieldsMap($entityTypeID) as $countryId => $fields)
		$indexedFieldsMap[$countryId] = array_fill_keys($fields, true);

	if (!empty($indexedFieldsMap))
	{
		foreach ($fieldsMap as $countryId => $fields)
		{
			foreach ($fields as $fieldName)
			{
				if (isset($indexedFieldsMap[$countryId][$fieldName]))
				{
					$scope = $byScope ? EntityBankDetail::formatDuplicateCriterionScope($countryId) : $countryId;
					if (!isset($result[$scope]))
						$result[$scope] = array();
					$result[$scope][] = $fieldName;
				}
			}
		}
	}

	return $result;
}