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
framework
View
Element
UiComponent
ContentType
ContentTypeFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Element\UiComponent\ContentType
;
7
8
use
Magento\Framework\ObjectManagerInterface
;
9
13
class
ContentTypeFactory
14
{
20
protected
$types
;
21
27
protected
$objectManager
;
28
35
public
function
__construct
(
ObjectManagerInterface
$objectManager
, array
$types
)
36
{
37
$this->types =
$types
;
38
$this->objectManager =
$objectManager
;
39
}
40
48
public
function
get
(
$type
)
49
{
50
if
(!isset($this->types[
$type
])) {
51
throw
new \InvalidArgumentException(sprintf(
"Wrong content type '%s', renderer not exists."
,
$type
));
52
}
53
54
$contentRender = $this->objectManager->get($this->types[
$type
]);
55
if
(!$contentRender instanceof
ContentTypeInterface
) {
56
throw
new \InvalidArgumentException(
57
sprintf(
'"%s" must implement the interface ContentTypeInterface.'
, $this->types[
$type
])
58
);
59
}
60
61
return
$contentRender;
62
}
63
}
Magento\Framework\View\Element\UiComponent\ContentType\ContentTypeFactory\__construct
__construct(ObjectManagerInterface $objectManager, array $types)
Definition:
ContentTypeFactory.php:35
Magento\Framework\View\Element\UiComponent\ContentType
Definition:
AbstractContentType.php:6
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\View\Element\UiComponent\ContentType\ContentTypeFactory\$objectManager
$objectManager
Definition:
ContentTypeFactory.php:27
$type
$type
Definition:
item.phtml:13
Magento\Framework\View\Element\UiComponent\ContentType\ContentTypeInterface
Definition:
ContentTypeInterface.php:13
Magento\Framework\View\Element\UiComponent\ContentType\ContentTypeFactory\$types
$types
Definition:
ContentTypeFactory.php:20
Magento\Framework\View\Element\UiComponent\ContentType\ContentTypeFactory
Definition:
ContentTypeFactory.php:13