• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Settings/Preset/Preset.php
  • Класс: BitrixImV2SettingsPresetPreset
  • Вызов: Preset::loadFromCache
private function loadFromCache(int $id): Result
{
	$result = new Result();
	$cache = CacheManager::getPresetCache($id);
	$presetValue = $cache->getValue();

	if (!empty($presetValue))
	{
		$this->id = $id;
		$this->name = $presetValue['name'];
		$this->sort = $presetValue['sort'];
		$this->personalUserId = $presetValue['userId'];
		$this->notify->load($presetValue['notify'] ?? []);
		$this->general->load($presetValue['general'] ?? []);

		return $result->setResult(true);
	}

	return $result->addError(new PresetError(PresetError::NOT_FOUND));
}