• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Settings/UserConfiguration.php
  • Класс: BitrixImV2SettingsUserConfiguration
  • Вызов: UserConfiguration::updateGeneralSetting
public function updateGeneralSetting(array $settingsConfiguration)
{
	if (!$this->generalPreset->isPersonal($this->userId))
	{
		$personalPreset = Preset::getPersonal($this->userId);

		if ($personalPreset->isExist())
		{
			$this->generalPreset = $personalPreset;
		}
		else
		{
			$personalPreset = Preset::getInstance();
			$personalPreset->initPersonal($this->userId);
			$this->generalPreset = $personalPreset;
		}

		$this->generalPreset->bindToUser($this->userId, [Preset::BIND_GENERAL]);
		CacheManager::getUserCache($this->userId)->clearCache();
	}

	$this->generalPreset->general->updateSetting($settingsConfiguration);
	$this->perfomSideEffect($settingsConfiguration);

	if (!$this->generalPreset->general->shouldUpdateSimpleNotifySettings($settingsConfiguration))
	{
		CacheManager::getPresetCache($this->generalPreset->getId())->clearCache();

		return;
	}
	if (!$this->notifyPreset->isPersonal($this->userId))
	{
		$this->notifyPreset = $this->generalPreset;
		$this->notifyPreset->bindToUser($this->userId, [Preset::BIND_NOTIFY]);
		CacheManager::getUserCache($this->userId)->clearCache();
	}

	$simpleSchema = $this->generalPreset->general->getSimpleNotifyScheme();
	$this->notifyPreset->notify->updateSimpleSettings($simpleSchema);

	CacheManager::getPresetCache($this->notifyPreset->getId())->clearCache();
}