• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/paysysteminner.php
  • Класс: BitrixSaleInternalsPaySystemInner
  • Вызов: PaySystemInner::getId
static function getId($useCache = true)
{
	$id = 0;
	$cacheManager = BitrixMainApplication::getInstance()->getManagedCache();
	$ttl = $useCache ? self::TTL : 0;

	if($cacheManager->read($ttl, self::CACHE_ID))
		$id = $cacheManager->get(self::CACHE_ID);

	if(intval($id) <= 0)
	{
		$dbRes = PaySystemManager::getList(array(
			'filter' => array('ACTION_FILE' => self::ACTION_FILE_TEXT),
			'select' => array('PAY_SYSTEM_ID')
			)
		);

		if($res = $dbRes->fetch())
		{
			$id = $res['PAY_SYSTEM_ID'];
			$cacheManager->set(self::CACHE_ID, $id);
		}
	}

	return intval($id);
}