Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Validator
Currency.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Validator
;
8
9
use
Magento\Framework\Setup\Lists
;
10
14
class
Currency
15
{
19
protected
$lists
;
20
26
public
function
__construct
(
Lists
$lists
)
27
{
28
$this->lists =
$lists
;
29
}
30
38
public
function
isValid
($currencyCode)
39
{
40
$isValid =
true
;
41
$allowedCurrencyCodes = array_keys($this->lists->getCurrencyList());
42
43
if
(!$currencyCode || !in_array($currencyCode, $allowedCurrencyCodes)) {
44
$isValid =
false
;
45
}
46
47
return
$isValid;
48
}
49
}
Magento\Framework\Validator\Currency\isValid
isValid($currencyCode)
Definition:
Currency.php:38
Magento\Framework\Validator\Currency
Definition:
Currency.php:14
Magento\Framework\Setup\Lists
Definition:
Lists.php:15
Magento\Framework\Validator
Definition:
AbstractValidator.php:6
Magento\Framework\Validator\Currency\$lists
$lists
Definition:
Currency.php:19
Magento\Framework\Validator\Currency\__construct
__construct(Lists $lists)
Definition:
Currency.php:26