• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/volume/base.php
  • Класс: Bitrix\Crm\Volume\name
  • Вызов: name::getIndicator
static function getIndicator($indicatorId)
{
	if (!$indicatorId)
	{
		throw new Main\ArgumentNullException('Wrong parameter indicatorTypeId');
	}

	if (mb_strpos($indicatorId, __NAMESPACE__) !== false)
	{
		$className = $indicatorId;
	}
	else
	{
		$className = __NAMESPACE__.'\\'.str_replace('_', '\\', $indicatorId);
	}

	/** @var Volume\IVolumeIndicator $indicator */
	$indicator = new $className();
	if (!$indicator instanceof Volume\IVolumeIndicator)
	{
		throw new Main\ObjectException('Return must implements '. __NAMESPACE__. '\\IVolumeIndicator interface.');
	}

	return $indicator;
}