12 if (!isset(static::$listCurrencyCache))
14 static::$listCurrencyCache = [];
16 $separators = \CCurrencyLang::GetSeparators();
17 $defaultFormat = \CCurrencyLang::GetDefaultValues();
18 $defaultFormat[
'SEPARATOR'] = $separators[$defaultFormat[
'THOUSANDS_VARIANT']];
20 $iterator = Currency\CurrencyTable::getList([
31 while ($row = $iterator->fetch())
34 $row[
'NAME'] = $row[
'CURRENCY'];
35 static::$listCurrencyCache[$row[
'CURRENCY']] = array_merge($row, $defaultFormat);
37 if (!empty(static::$listCurrencyCache))
39 $iterator = Currency\CurrencyLangTable::getList([
51 '@CURRENCY' => array_keys(static::$listCurrencyCache),
52 '=LID' => LANGUAGE_ID,
55 while ($row = $iterator->fetch())
57 $currencyId = $row[
'CURRENCY'];
58 $row[
'FULL_NAME'] = (string)$row[
'FULL_NAME'];
59 if ($row[
'FULL_NAME'] !==
'')
61 static::$listCurrencyCache[$currencyId][
'NAME'] = $row[
'FULL_NAME'];
64 unset($row[
'FULL_NAME'], $row[
'CURRENCY']);
65 static::$listCurrencyCache[$currencyId] = array_merge(
66 static::$listCurrencyCache[$currencyId],
70 if ($row[
'THOUSANDS_VARIANT'] !==
null && isset($separators[$row[
'THOUSANDS_VARIANT']]))
72 static::$listCurrencyCache[$currencyId][
'SEPARATOR'] = $separators[$row[
'THOUSANDS_VARIANT']];
75 static::$listCurrencyCache[$currencyId][
'SEPARATOR'] =
' ';
80 static::$listCurrencyCache[$currencyId][
'SEPARATOR'] = $row[
'THOUSANDS_SEP'];
84 unset($row, $iterator);
87 return static::$listCurrencyCache;