• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/configuration/action/import.php
  • Класс: BitrixRestConfigurationActionImport
  • Вызов: Import::doLoad
public function doLoad($step, $code, $content): array
{
	$result = [
		'result' => true,
	];

	if ($content['COUNT'] > $step)
	{
		$result['result'] = false;
	}

	if (!is_null($content['DATA']))
	{
		$ratio = $this->getSetting()->get(Setting::SETTING_RATIO);
		$additionalOption = $this->getSetting()->get(Setting::SETTING_ACTION_ADDITIONAL_OPTION);
		$dataList = Controller::callEventImport(
			[
				'CODE' => $code,
				'CONTENT' => $content,
				'RATIO' => $ratio,
				'CONTEXT' => $this->getContextEntity(),
				'CONTEXT_USER' => $this->getContext(),
				'MANIFEST_CODE' => $this->getManifestCode(),
				'IMPORT_MANIFEST' => Manifest::get($this->getManifestCode()),
				'ADDITIONAL_OPTION' => $additionalOption,
			]
		);

		foreach ($dataList as $data)
		{
			if (is_array($data['RATIO']))
			{
				if (empty($ratio[$code]))
				{
					$ratio[$code] = [];
				}
				foreach ($data['RATIO'] as $old => $new)
				{
					$ratio[$code][$old] = $new;
				}
			}

			$this->getNotificationInstance()->save($data);
		}

		$this->getSetting()->set(Setting::SETTING_RATIO, $ratio);
	}

	return $result;
}