• Модуль: salescenter
  • Путь к файлу: ~/bitrix/modules/salescenter/lib/integration/restmanager.php
  • Класс: BitrixSalesCenterIntegrationRestManager
  • Вызов: RestManager::getMarketplaceAppsCount
public function getMarketplaceAppsCount(string $category)
{
	$cacheId = "salescenter_categoty_{$category}_count";
	$cachePath = "/salescenter/saleshub/count/{$category}/";
	$cache = MainApplication::getInstance()->getCache();

	if ($cache->initCache(self::DEFAULT_CACHE_TTL, $cacheId, $cachePath))
	{
		$categoryItems = $cache->getVars();
	}
	else
	{
		$categoryItems = RestMarketplaceClient::getCategory($category, 0, 1);
		if (is_array($categoryItems))
		{
			$cache->startDataCache();
			$cache->endDataCache($categoryItems);
		}
	}

	return $categoryItems['PAGES'] ?? 0;
}