• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Router.php
  • Класс: Bitrix\Crm\Service\Router
  • Вызов: Router::getEntityTypeByComponent
public function getEntityTypeByComponent(string $componentName, array $componentParams): int
{
	static $map = null;

	if ($map === null)
	{
		$map = array_flip($this->getItemDetailComponentNamesMap());
	}

	$entityTypeId = isset($map[$componentName]) ? (int)$map[$componentName] : \CCrmOwnerType::Undefined;

	if (!\CCrmOwnerType::IsDefined($entityTypeId) && isset($componentParams['ENTITY_TYPE_ID']))
	{
		$entityTypeId = (int)$componentParams['ENTITY_TYPE_ID'];
	}

	return $entityTypeId;
}