Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
currency.php
1
<?php
2
3
namespace
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup
;
4
5
use
Bitrix\Main\Loader
;
6
use
Bitrix\Currency\CurrencyManager
;
7
use
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields
;
8
9
final
class
Currency
implements
Fields\IField
,
Fields\IAvailableFieldList
10
{
16
public
static
function
getDefaultValue
()
17
{
18
return
in_array($current = self::getDefaultCurrency(),static::getCurrencyList())? $current :
'USD'
;
19
}
20
21
private
static
function
getDefaultCurrency()
22
{
23
if
(Loader::includeModule(
'bitrix24'
) && is_array($currencies = \CBitrix24::GetAvBillingCurrencies()))
24
{
25
$currentCurrency = current($currencies);
26
return
$currentCurrency !==
'RUR'
? $currentCurrency :
'RUB'
;
27
}
28
29
if
(Loader::includeModule(
'currency'
))
30
{
31
return
CurrencyManager::getBaseCurrency();
32
}
33
return
false
;
34
}
35
45
public
static
function
checkValue
($value): bool
46
{
47
if
(is_string($value))
48
{
49
return
in_array($value,static::getAvailableValues());
50
}
51
return
false
;
52
}
53
60
public
static
function
getAvailableValues
(): array
61
{
62
return
static::getCurrencyList();
63
}
64
68
public
static
function
available
(): bool
69
{
70
return
true
;
71
72
}
73
77
public
static
function
required
(): bool
78
{
79
return
true
;
80
}
81
82
public
static
function
getCurrencyList
() : array
83
{
84
return
[
85
'DZD'
,
'ARS'
,
'AUD'
,
'BDT'
,
'BOB'
,
'BRL'
,
'GBP'
,
'CAD'
,
'CLP'
,
'CNY'
,
'COP'
,
'CRC'
,
'CZK'
,
'DKK'
,
'EGP'
,
'EUR'
,
86
'GTQ'
,
'HNL'
,
'HKD'
,
'HUF'
,
'ISK'
,
'INR'
,
'IDR'
,
'ILS'
,
'JPY'
,
'KES'
,
'KRW'
,
'MOP'
,
'MYR'
,
'MXN'
,
'NZD'
,
'NIO'
,
87
'NGN'
,
'NOK'
,
'PKR'
,
'PYG'
,
'PEN'
,
'PHP'
,
'PLN'
,
'QAR'
,
'RON'
,
'RUB'
,
'SAR'
,
'SGD'
,
'ZAR'
,
'SEK'
,
'CHF'
,
'TWD'
,
88
'THB'
,
'TRY'
,
'AED'
,
'USD'
,
'UYU'
,
'VEF'
,
'VND'
89
];
90
}
91
}
Bitrix\Currency\CurrencyManager
Definition
currencymanager.php:15
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency
Definition
currency.php:10
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\getDefaultValue
static getDefaultValue()
Definition
currency.php:16
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\checkValue
static checkValue($value)
Definition
currency.php:45
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\getAvailableValues
static getAvailableValues()
Definition
currency.php:60
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\getCurrencyList
static getCurrencyList()
Definition
currency.php:82
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\available
static available()
Definition
currency.php:68
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup\Currency\required
static required()
Definition
currency.php:77
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\IAvailableFieldList
Definition
iavailablefieldlist.php:6
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\IField
Definition
ifield.php:6
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Setup
Definition
businessid.php:3
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields
modules
seo
lib
businesssuite
configuration
facebook
fields
setup
currency.php
Создано системой
1.10.0