• Модуль: salescenter
  • Путь к файлу: ~/bitrix/modules/salescenter/lib/integration/locationmanager.php
  • Класс: BitrixSalesCenterIntegrationLocationManager
  • Вызов: LocationManager::getLocationsFromList
public function getLocationsFromList(): ?array
{
	$optionValue = MainConfigOption::get('salescenter', 'default_location_from');
	if (!$optionValue)
	{
		return null;
	}

	if (!CheckSerializedData($optionValue))
	{
		return null;
	}

	$defaultLocationsFrom = unserialize($optionValue, ['allowed_classes' => false]);
	if (!$defaultLocationsFrom)
	{
		return null;
	}

	/**
	 * If it's a single location we must turn it into array
	 */
	if (
		array_key_exists('externalId', $defaultLocationsFrom)
		|| array_key_exists('name', $defaultLocationsFrom)
		|| array_key_exists('address', $defaultLocationsFrom)
	)
	{
		$defaultLocationsFrom = [
			$this->makeLocationCode($defaultLocationsFrom) => $defaultLocationsFrom,
		];
	}

	return $defaultLocationsFrom;
}