• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/widget/cache.php
  • Класс: BitrixImOpenLinesWidgetCache
  • Вызов: Cache::set
static function set(int $userId, array $params): bool
{
	$cache = BitrixMainDataCache::createInstance();

	$result = [];

	if (!empty($params))
	{
		if ($cache->initCache(self::$cacheTtl, $userId, self::$cacheDir))
		{
			$result = $cache->getVars();
		}

		foreach ($params as $name => $value)
		{
			if ($value === '')
			{
				unset($result[$name]);
			}
			else
			{
				$result[$name] = $value;
			}
		}
	}

	$cache->forceRewriting(true);
	$cache->startDataCache(self::$cacheTtl, $userId, self::$cacheDir);
	$cache->endDataCache($result);

	return true;
}