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
Command
CommandPool.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Payment\Gateway\Command
;
8
9
use
Magento\Framework\ObjectManager\TMap
;
10
use
Magento\Payment\Gateway\CommandInterface
;
11
use
Magento\Framework\Exception\NotFoundException
;
12
use
Magento\Framework\ObjectManager\TMapFactory
;
13
19
class
CommandPool
implements
CommandPoolInterface
20
{
24
private
$commands;
25
30
public
function
__construct
(
31
TMapFactory
$tmapFactory,
32
array $commands = []
33
) {
34
$this->commands = $tmapFactory->
create
(
35
[
36
'array'
=> $commands,
37
'type'
=> CommandInterface::class
38
]
39
);
40
}
41
49
public
function
get
($commandCode)
50
{
51
if
(!isset($this->commands[$commandCode])) {
52
throw
new
NotFoundException
(
53
__
(
'The "%1" command doesn\'t exist. Verify the command and try again.'
, $commandCode)
54
);
55
}
56
57
return
$this->commands[$commandCode];
58
}
59
}
Magento\Framework\ObjectManager\TMapFactory\create
create(array $args)
Definition:
TMapFactory.php:33
__
__()
Definition:
__.php:13
Magento\Payment\Gateway\Command\CommandPoolInterface
Definition:
CommandPoolInterface.php:17
Magento\Payment\Gateway\Command
Definition:
CommandException.php:6
Magento\Framework\Exception\NotFoundException
Definition:
NotFoundException.php:12
Magento\Framework\ObjectManager\TMapFactory
Definition:
TMapFactory.php:13
Magento\Framework\ObjectManager\TMap
Definition:
TMap.php:14
Magento\Payment\Gateway\CommandInterface
Definition:
CommandInterface.php:16
Magento\Payment\Gateway\Command\CommandPool
Definition:
CommandPool.php:19
Magento\Payment\Gateway\Command\CommandPool\__construct
__construct(TMapFactory $tmapFactory, array $commands=[])
Definition:
CommandPool.php:30