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-deploy
Console
Command
App
SensitiveConfigSet
CollectorFactory.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Deploy\Console\Command\App\SensitiveConfigSet
;
8
9
use
Magento\Framework\Exception\LocalizedException
;
10
use
Magento\Framework\ObjectManagerInterface
;
11
15
class
CollectorFactory
16
{
20
const
TYPE_INTERACTIVE
=
'interactive'
;
21
25
const
TYPE_SIMPLE
=
'simple'
;
26
32
private
$objectManager;
33
37
private
$types = [];
38
45
public
function
__construct
(
46
ObjectManagerInterface
$objectManager,
47
array $types = []
48
) {
49
$this->objectManager =
$objectManager
;
50
$this->types = $types;
51
}
52
65
public
function
create
(
$type
)
66
{
67
if
(!isset($this->types[
$type
])) {
68
throw
new
LocalizedException
(
69
__
(
'The class for "%1" type wasn\'t declared. Enter the class and try again.'
,
$type
)
70
);
71
}
72
73
$object = $this->objectManager->create($this->types[
$type
]);
74
75
if
(!$object instanceof
CollectorInterface
) {
76
throw
new
LocalizedException
(
77
__
(
'%1 does not implement %2'
, get_class($object), CollectorInterface::class)
78
);
79
}
80
81
return
$object;
82
}
83
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorFactory\TYPE_INTERACTIVE
const TYPE_INTERACTIVE
Definition:
CollectorFactory.php:20
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
__
__()
Definition:
__.php:13
$type
$type
Definition:
item.phtml:13
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorInterface
Definition:
CollectorInterface.php:15
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorFactory
Definition:
CollectorFactory.php:15
Magento\Deploy\Console\Command\App\SensitiveConfigSet
Definition:
CollectorFactory.php:7
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorFactory\__construct
__construct(ObjectManagerInterface $objectManager, array $types=[])
Definition:
CollectorFactory.php:45
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorFactory\create
create($type)
Definition:
CollectorFactory.php:65
Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorFactory\TYPE_SIMPLE
const TYPE_SIMPLE
Definition:
CollectorFactory.php:25