• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/configuration/structure.php
  • Класс: BitrixRestConfigurationStructure
  • Вызов: Structure::saveContent
public function saveContent($type, $code, $content)
{
	$return = false;

	try
	{
		if (is_array($content))
		{
			$content = Json::encode($content);
		}
		elseif (!is_string($content))
		{
			return $return;
		}

		$path = ($type === false ? '' : $type . '/') . $code . Helper::CONFIGURATION_FILE_EXTENSION;

		$id = CFile::SaveFile(
			[
				'name' => $path,
				'MODULE_ID' => 'rest',
				'content' => $content,
				'description' => self::$fileDescriptionDelete
			],
			'configuration/export'
		);

		if ($id > 0)
		{
			$return = $this->saveConfigurationFile($id, $path);
		}
	}
	catch (Exception $e)
	{
	}

	return $return;
}