Item::convertFieldId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Item
  4. convertFieldId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/bizproc/document/item.php
  • Класс: Bitrix\Crm\Integration\BizProc\Document\Item
  • Вызов: Item::convertFieldId
static function convertFieldId(string $fieldId, int $convertTo = self::CONVERT_TO_BP): string
{
	$map = [
		Crm\Item::FIELD_NAME_OBSERVERS => 'OBSERVER_IDS',
		Crm\Item::FIELD_NAME_PRODUCTS => 'PRODUCT_IDS',
	];

	if ($fieldId === Crm\Item::FIELD_NAME_CONTACTS)
	{
		return 'CONTACT_IDS';
	}
	if ($convertTo === self::CONVERT_TO_DOCUMENT)
	{
		$map = array_flip($map);
	}

	return array_key_exists($fieldId, $map) ? $map[$fieldId] : $fieldId;
}

Добавить комментарий