• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integrity/duplicatebankdetailmatchcode.php
  • Класс: Bitrix\Crm\Integrity\DuplicateBankDetailMatchCodeTable
  • Вызов: DuplicateBankDetailMatchCodeTable::getIndexedFieldsMap
static function getIndexedFieldsMap($entityTypeID = \CCrmOwnerType::Undefined)
{
	if(!is_int($entityTypeID))
	{
		throw new Main\ArgumentTypeException('entityTypeID', 'integer');
	}

	$sql = 'SELECT DISTINCT BD_COUNTRY_ID, BD_FIELD_NAME FROM b_crm_dp_bd_mcd';
	if ($entityTypeID !== \CCrmOwnerType::Undefined)
		$sql .= ' WHERE ENTITY_TYPE_ID = '.$entityTypeID;
	$connection = Application::getConnection();
	$res = $connection->query($sql);
	$results = array();
	while($row = $res->fetch())
	{
		$results[$row['BD_COUNTRY_ID']][] = $row['BD_FIELD_NAME'];
	}
	return $results;
}