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
module-payment
Gateway
Config
ValueHandlerPool.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Payment\Gateway\Config
;
7
8
use
Magento\Framework\ObjectManager\TMap
;
9
use
Magento\Framework\ObjectManager\TMapFactory
;
10
20
class
ValueHandlerPool
implements
\Magento\Payment\Gateway\Config\ValueHandlerPoolInterface
21
{
25
const
DEFAULT_HANDLER
=
'default'
;
26
30
private
$handlers;
31
36
public
function
__construct
(
37
TMapFactory
$tmapFactory,
38
array $handlers
39
) {
40
if
(!isset($handlers[self::DEFAULT_HANDLER])) {
41
throw
new \LogicException(
'Default handler should be provided.'
);
42
}
43
44
$this->handlers = $tmapFactory->
create
(
45
[
46
'array'
=> $handlers,
47
'type'
=> ValueHandlerInterface::class
48
]
49
);
50
}
51
58
public
function
get
($field)
59
{
60
return
isset($this->handlers[$field])
61
? $this->handlers[$field]
62
: $this->handlers[
self::DEFAULT_HANDLER
];
63
}
64
}
Magento\Framework\ObjectManager\TMapFactory\create
create(array $args)
Definition:
TMapFactory.php:33
Magento\Payment\Gateway\Config\ValueHandlerPool\__construct
__construct(TMapFactory $tmapFactory, array $handlers)
Definition:
ValueHandlerPool.php:36
Magento\Payment\Gateway\Config\ValueHandlerPool\DEFAULT_HANDLER
const DEFAULT_HANDLER
Definition:
ValueHandlerPool.php:25
Magento\Payment\Gateway\Config\ValueHandlerPool
Definition:
ValueHandlerPool.php:20
Magento\Payment\Gateway\Config\ValueHandlerPoolInterface
Definition:
ValueHandlerPoolInterface.php:16
Magento\Framework\ObjectManager\TMapFactory
Definition:
TMapFactory.php:13
Magento\Framework\ObjectManager\TMap
Definition:
TMap.php:14
Magento\Payment\Gateway\Config
Definition:
Config.php:6