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

	$sql = 'SELECT DISTINCT RQ_COUNTRY_ID, RQ_FIELD_NAME FROM b_crm_dp_rq_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['RQ_COUNTRY_ID']][] = $row['RQ_FIELD_NAME'];
	}
	return $results;
}