• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/businesssuite/configuration/facebook/installs.php
  • Класс: BitrixSeoBusinessSuiteConfigurationFacebookInstalls
  • Вызов: Installs::load
static function load() : ?self
{
	if(!self::$current)
	{
		self::$current = new static();
		$cache = Application::getInstance()->getManagedCache();
		if ($cache->read(self::FACEBOOK_INSTALLS_TTL,self::FACEBOOK_INSTALLS_CACHE_ID))
		{
			self::$current->value = $cache->get(self::FACEBOOK_INSTALLS_CACHE_ID);
		}
		elseif
		(
			($adapter = ServiceAdapter::loadFacebookService())
			&& ($response = $adapter->getExtension()->getInstalls())
			&& $response->isSuccess()
		)
		{
			$cache->set(self::FACEBOOK_INSTALLS_CACHE_ID, self::$current->value = $response->fetch());
		}
	}

	return self::$current;
}