Helper::preparePersonalizeList

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. Helper
  4. preparePersonalizeList
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/crm/connectors/helper.php
  • Класс: Bitrix\Sender\Integration\Crm\Connectors\Helper
  • Вызов: Helper::preparePersonalizeList
static function preparePersonalizeList(string $entityType, array $fields): array
{
	$result = [];
	$items = [];

	$counter = 0;
	foreach ($fields as $fieldCode  => $field)
	{
		$items[$counter++] = [
			'CODE' => $entityType.'.'.$fieldCode,
			'NAME' => $field['Name'],
			'DESC' => $field['Name'],
		];
		if(isset($field['personalizeCode']) && $field['personalizeCode'])
		{
			$items[$counter - 1]['CODE'] = implode(
				"##",
				Integration\Crm\Connectors\Personalize\BasePersonalize::getMap()[$field['personalizeCode']]
			);
		}
	}

	$name = Loc::getMessage('SENDER_INTEGRATION_CRM_CONNECTOR_'.$entityType);
	if (Loader::includeModule('crm'))
	{
		$name = \CCrmOwnerType::GetDescription(\CCrmOwnerType::ResolveID($entityType));
	}
	$result[] = [
		'CODE' => $entityType,
		'NAME' => $name,
		'ITEMS' => $items
	];

	return $result;
}

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