• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/statmethod.php
  • Класс: BitrixRestStatMethodTable
  • Вызов: StatMethodTable::loadFromCache
static function loadFromCache($force = false)
{
	$managedCache = MainApplication::getInstance()->getManagedCache();
	$cacheId = 'stat_method_cache';

	if($force)
	{
		static::$methodCache = null;
		$managedCache->clean($cacheId);
	}

	if(static::$methodCache === null)
	{
		if($managedCache->read(86400, $cacheId))
		{
			static::$methodCache = $managedCache->get($cacheId);
		}
		else
		{
			static::$methodCache = array();
			$dbRes = static::getList();
			while($method = $dbRes->fetch())
			{
				static::$methodCache[$method['NAME']] = $method['ID'];
			}
			$managedCache->set($cacheId, static::$methodCache);
		}
	}
}