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-instant-purchase
Model
ShippingMethodChoose
DeferredShippingMethodChooserPool.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\InstantPurchase\Model\ShippingMethodChoose
;
7
15
class
DeferredShippingMethodChooserPool
16
{
17
private
$choosers;
18
22
public
function
__construct
(array $choosers)
23
{
24
foreach
($choosers as $chooser) {
25
if
(!$chooser instanceof
DeferredShippingMethodChooserInterface
) {
26
throw
new \InvalidArgumentException(sprintf(
27
'Invalid configuration. Chooser should be instance of %s.'
,
28
DeferredShippingMethodChooserInterface::class
29
));
30
}
31
}
32
$this->choosers = $choosers;
33
}
34
40
public
function
get
(
$type
) :
DeferredShippingMethodChooserInterface
41
{
42
if
(!isset($this->choosers[
$type
])) {
43
throw
new \InvalidArgumentException(sprintf(
44
'Deferred shipping method %s is not registered.'
,
45
$type
46
));
47
}
48
49
return
$this->choosers[
$type
];
50
}
51
}
Magento\InstantPurchase\Model\ShippingMethodChoose
Definition:
CarrierFinder.php:6
Magento\InstantPurchase\Model\ShippingMethodChoose\DeferredShippingMethodChooserInterface
Definition:
DeferredShippingMethodChooserInterface.php:16
$type
$type
Definition:
item.phtml:13
Magento\InstantPurchase\Model\ShippingMethodChoose\DeferredShippingMethodChooserPool\__construct
__construct(array $choosers)
Definition:
DeferredShippingMethodChooserPool.php:22
Magento\InstantPurchase\Model\ShippingMethodChoose\DeferredShippingMethodChooserPool
Definition:
DeferredShippingMethodChooserPool.php:15