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-config
Console
Command
ConfigSet
ConfigSetProcessorFactory.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Config\Console\Command\ConfigSet
;
8
9
use
Magento\Config\Console\Command\ConfigSetCommand
;
10
use
Magento\Framework\Exception\ConfigurationMismatchException
;
11
use
Magento\Framework\ObjectManagerInterface
;
12
22
class
ConfigSetProcessorFactory
23
{
30
const
TYPE_DEFAULT
=
'default'
;
31
36
const
TYPE_LOCK
=
'lock'
;
37
const
TYPE_LOCK_ENV
=
'lock-env'
;
38
const
TYPE_LOCK_CONFIG
=
'lock-config'
;
42
private
$objectManager;
43
50
private
$processors;
51
56
public
function
__construct
(
57
ObjectManagerInterface
$objectManager,
58
array $processors = []
59
) {
60
$this->objectManager =
$objectManager
;
61
$this->processors = $processors;
62
}
63
73
public
function
create
($processorName)
74
{
75
if
(!isset($this->processors[$processorName])) {
76
throw
new
ConfigurationMismatchException
(
77
__
(
'The class for "%1" type wasn\'t declared. Enter the class and try again.'
, $processorName)
78
);
79
}
80
81
$object = $this->objectManager->create($this->processors[$processorName]);
82
83
if
(!$object instanceof
ConfigSetProcessorInterface
) {
84
throw
new
ConfigurationMismatchException
(
85
__
(
'%1 should implement %2'
, get_class($object), ConfigSetProcessorInterface::class)
86
);
87
}
88
89
return
$object;
90
}
91
}
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\TYPE_LOCK_ENV
const TYPE_LOCK_ENV
Definition:
ConfigSetProcessorFactory.php:37
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory
Definition:
ConfigSetProcessorFactory.php:22
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\create
create($processorName)
Definition:
ConfigSetProcessorFactory.php:73
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\TYPE_DEFAULT
const TYPE_DEFAULT
Definition:
ConfigSetProcessorFactory.php:30
__
__()
Definition:
__.php:13
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorInterface
Definition:
ConfigSetProcessorInterface.php:19
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\__construct
__construct(ObjectManagerInterface $objectManager, array $processors=[])
Definition:
ConfigSetProcessorFactory.php:56
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\TYPE_LOCK
const TYPE_LOCK
Definition:
ConfigSetProcessorFactory.php:36
Magento\Config\Console\Command\ConfigSetCommand
Definition:
ConfigSetCommand.php:29
Magento\Framework\Exception\ConfigurationMismatchException
Definition:
ConfigurationMismatchException.php:13
Magento\Config\Console\Command\ConfigSet
Definition:
ConfigSetProcessorFactory.php:7
Magento\Config\Console\Command\ConfigSet\ConfigSetProcessorFactory\TYPE_LOCK_CONFIG
const TYPE_LOCK_CONFIG
Definition:
ConfigSetProcessorFactory.php:38