• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/update/chatconfigconnectionsrestorer.php
  • Класс: BitrixImUpdateChatConfigConnectionsRestorer
  • Вызов: ChatConfigConnectionsRestorer::installDefaultPreset
public function installDefaultPreset(): int
{
	$defaultGroupId =
		BitrixImModelOptionGroupTable::add([
			'NAME' => Configuration::DEFAULT_PRESET_NAME,
			'SORT' => 0,
			'CREATE_BY_ID' => 0,
		])
			->getId()
	;

	$generalDefaultSettings = General::getDefaultSettings();
	General::setSettings($defaultGroupId, $generalDefaultSettings);

	$notifySettings = Notification::getSimpleNotifySettings($generalDefaultSettings);
	Notification::setSettings($defaultGroupId, $notifySettings);

	if (Loader::includeModule('intranet'))
	{
		$topDepartmentId = Department::getTopDepartmentId();
		OptionAccessTable::add([
			'GROUP_ID' => $defaultGroupId,
			'ACCESS_CODE' => $topDepartmentId ? 'DR' . $topDepartmentId : 'AU'
		]);
	}

	Option::set('im', Configuration::DEFAULT_PRESET_SETTING_NAME, (int)$defaultGroupId);

	return (int)$defaultGroupId;
}