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
Design
Theme
Customization
FileServiceFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Design\Theme\Customization
;
7
11
class
FileServiceFactory
12
{
18
protected
$_objectManager
;
19
26
public
function
__construct
(\
Magento
\Framework\
ObjectManagerInterface
$objectManager
,
ConfigInterface
$config
)
27
{
28
$this->_objectManager =
$objectManager
;
29
$this->_types =
$config
->getFileTypes();
30
}
31
40
public
function
create
(
$type
, array
$data
= [])
41
{
42
if
(empty($this->_types[
$type
])) {
43
throw
new \InvalidArgumentException(
'Unsupported file type'
);
44
}
45
$fileService = $this->_objectManager->get($this->_types[
$type
], [
$data
]);
46
if
(!$fileService instanceof \
Magento
\Framework\View\Design\
Theme
\
Customization
\
FileInterface
) {
47
throw
new \InvalidArgumentException(
'Service don\'t implement interface'
);
48
}
49
return
$fileService;
50
}
51
}
Magento\Framework\View\Design\Theme\Customization
Definition:
AbstractFile.php:6
$objectManager
$objectManager
Definition:
bootstrap.php:17
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\View\Design\Theme\Customization
Definition:
Customization.php:11
Magento\Framework\View\Design\Theme\Customization\FileServiceFactory
Definition:
FileServiceFactory.php:11
$type
$type
Definition:
item.phtml:13
Magento\Framework\View\Design\Theme\Customization\FileServiceFactory\$_objectManager
$_objectManager
Definition:
FileServiceFactory.php:18
Magento\Framework\View\Design\Theme\Customization\FileServiceFactory\__construct
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, ConfigInterface $config)
Definition:
FileServiceFactory.php:26
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\View\Design\Theme\Customization\FileServiceFactory\create
create($type, array $data=[])
Definition:
FileServiceFactory.php:40
Magento
Magento\Framework\View\Design\Theme\Customization\ConfigInterface
Definition:
ConfigInterface.php:11
Magento\Framework\Config\Theme
Definition:
Theme.php:16
Magento\Framework\View\Design\Theme\Customization\FileInterface
Definition:
FileInterface.php:11