• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/Configuration/Configuration.php
  • Класс: BitrixImConfigurationConfiguration
  • Вызов: Configuration::getUserPresetFromCache
static function getUserPresetFromCache(int $userId): array
{
	$result = [];
	$userCache = CacheManager::getUserCache($userId);
	$currentUserPresets = $userCache->getValue();

	if (isset($currentUserPresets['notifyPreset']))
	{
		$notifyPresetCache = CacheManager::getPresetCache($currentUserPresets['notifyPreset']);
		$notifyPreset = $notifyPresetCache->getValue();
		if (!empty($notifyPreset))
		{
			$result['notify'] = [
				'id' => $notifyPreset['id'],
				'name' => $notifyPreset['name'],
				'sort' => $notifyPreset['sort'],
				'settings' => $notifyPreset['notify']
			];
		}
	}

	if (isset($currentUserPresets['generalPreset']))
	{
		$generalPresetCache = CacheManager::getPresetCache($currentUserPresets['generalPreset']);
		$generalPreset = $generalPresetCache->getValue();
		if (!empty($generalPreset))
		{
			$result['general'] = [
				'id' => $generalPreset['id'],
				'name' => $generalPreset['name'],
				'sort' => $generalPreset['sort'],
				'settings' => $generalPreset['general']
			];
		}
	}

	return $result;
}