• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/gridvariation/gridstatestorage.php
  • Класс: BitrixCatalogComponentGridVariationGridStateStorage
  • Вызов: GridStateStorage::load
public function load(int $productId, string $gridId): GridState
{
	$state = new GridState($productId, $gridId);
	$key = $this->getStorageKey($productId, $gridId);
	$cache = Application::getInstance()->getLocalSession($key);

	// postponed every minute so that the pages do not stick forever.
	$deadline = (int)$cache->get(self::FIELD_DEADLINE);
	if ($deadline < time())
	{
		$cache->set(self::FIELD_DEADLINE, time() + self::DEADLINE_SEC);
	}
	else
	{
		$currentPage = $cache->get(self::FIELD_CURRENT_PAGE);
		if (isset($currentPage))
		{
			$state->setCurrentPage((int)$currentPage);
		}
	}

	return $state;
}