• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/intranet/bindingmenu/codebuilder.php
  • Класс: Bitrix\Crm\Integration\Intranet\BindingMenu\as
  • Вызов: as::getRestPlacementCode
static function getRestPlacementCode(string $sectionCode, int $entityTypeId): string
{
	if (($entityTypeId === \CCrmOwnerType::Deal) && ($sectionCode === SectionCode::TUNNELS))
	{
		return 'CRM_FUNNELS_TOOLBAR';
	}

	$templates = static::getRestPlacementCodeTemplates();

	$template = $templates[$sectionCode] ?? null;
	if (!is_string($template))
	{
		throw new ArgumentException('The provided section code does not exist', 'sectionCode');
	}

	return str_replace(
		'#ENTITY_TYPE_NAME#',
		mb_strtoupper(\CCrmOwnerType::ResolveName($entityTypeId)),
		$template
	);
}