• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/utm.php
  • Класс: Bitrix\Crm\UtmTable
  • Вызов: UtmTable::getFieldsDescriptionByEntityTypeId
static function getFieldsDescriptionByEntityTypeId($entityTypeId, $entitySqlTableAlias = 'L')
{
	$resultList = [];
	$codeList = self::getCodeList();
	foreach ($codeList as $code)
	{
		$fieldName = mb_strtoupper($code);
		$tableAlias = 'U_' . $fieldName;
		$resultList[$fieldName] = [
			'FIELD' => "{$tableAlias}.VALUE",
			'TYPE' => 'string',
			'FROM' => 'LEFT JOIN ' . self::getTableName() . " {$tableAlias} ON"
				. " {$tableAlias}.ENTITY_TYPE_ID = " . (int) $entityTypeId
				. " AND {$tableAlias}.ENTITY_ID = " . $entitySqlTableAlias . '.ID'
				. " AND {$tableAlias}.CODE = '" . $code . "'"
		];
	}

	return $resultList;
}