• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/infrastructure/service/config/factory.php
  • Класс: BitrixLocationInfrastructureServiceConfigFactory
  • Вызов: Factory::getServiceConfig
static function getServiceConfig(string $serviceType)
{
	$result = [];

	switch ($serviceType)
	{
		case LoggerService::class:
			$result = [
				'logger' => new LoggerServiceCEventLogger(),
				'logLevel'=> static::getLogLevel(),
				'eventsToLog' => []
			];
			break;

		case ErrorService::class:
			$result = [
				'logErrors' => true,
				'throwExceptionOnError' => false
			];
			break;

		case FormatService::class:
			$result = [
				'repository' => new FormatRepository([
					'dataCollection' => DataCollection::class //Format data collection
				]),
				'defaultFormatCode' => BitrixLocationInfrastructureFormatCode::getCurrent()
			];
			break;

		case AddressService::class:
			$result = [
				'repository' => new AddressRepository()
			];
			break;

		case SourceService::class:
			$result = [
				'source' => self::obtainSource()
			];
			break;

		case LocationService::class:
			$result = [
				'repository' => static::createLocationRepository(
					self::obtainSource()
				)
			];
			break;

		case CurrentRegionFinderService::class:
		case DisputedAreaService::class:
		case RecentAddressesService::class:
			break;

		default:
			throw new LogicException("Unknown service type "${serviceType}"", ErrorCodes::SERVICE_CONFIG_FABRIC_WRONG_SERVICE);
	}

	return $result;
}