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
Backup
Factory.php
Go to the documentation of this file.
1
<?php
10
namespace
Magento\Framework\Backup
;
11
12
use
Magento\Framework\Exception\LocalizedException
;
13
use
Magento\Framework\ObjectManagerInterface
;
14
use
Magento\Framework\Phrase
;
15
20
class
Factory
21
{
27
private
$_objectManager;
28
32
const
TYPE_DB
=
'db'
;
33
37
const
TYPE_FILESYSTEM
=
'filesystem'
;
38
42
const
TYPE_SYSTEM_SNAPSHOT
=
'snapshot'
;
43
47
const
TYPE_MEDIA
=
'media'
;
48
52
const
TYPE_SNAPSHOT_WITHOUT_MEDIA
=
'nomedia'
;
53
59
protected
$_allowedTypes
;
60
64
public
function
__construct
(
ObjectManagerInterface
$objectManager
)
65
{
66
$this->_objectManager =
$objectManager
;
67
$this->_allowedTypes = [
68
self::TYPE_DB
,
69
self::TYPE_FILESYSTEM
,
70
self::TYPE_SYSTEM_SNAPSHOT
,
71
self::TYPE_MEDIA
,
72
self::TYPE_SNAPSHOT_WITHOUT_MEDIA
,
73
];
74
}
75
83
public
function
create
(
$type
)
84
{
85
if
(!in_array(
$type
, $this->_allowedTypes)) {
86
throw
new
LocalizedException
(
87
new
Phrase
(
88
'Current implementation not supported this type (%1) of backup.'
,
89
[
$type
]
90
)
91
);
92
}
93
$class
=
'Magento\Framework\Backup\\'
. ucfirst(
$type
);
94
return
$this->_objectManager->create(
$class
);
95
}
96
}
Magento\Framework\Backup\Factory\TYPE_SNAPSHOT_WITHOUT_MEDIA
const TYPE_SNAPSHOT_WITHOUT_MEDIA
Definition:
Factory.php:52
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Framework\Backup\Factory\TYPE_FILESYSTEM
const TYPE_FILESYSTEM
Definition:
Factory.php:37
Magento\Framework\Backup
Definition:
AbstractBackup.php:6
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\Backup\Factory\TYPE_MEDIA
const TYPE_MEDIA
Definition:
Factory.php:47
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
$type
$type
Definition:
item.phtml:13
$class
$_option $_optionId $class
Definition:
date.phtml:13
Magento\Framework\Backup\Factory\TYPE_SYSTEM_SNAPSHOT
const TYPE_SYSTEM_SNAPSHOT
Definition:
Factory.php:42
Magento\Framework\Backup\Factory\create
create($type)
Definition:
Factory.php:83
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Phrase
Magento\Framework\Backup\Factory
Definition:
Factory.php:20
Magento\Framework\Backup\Factory\$_allowedTypes
$_allowedTypes
Definition:
Factory.php:59
Magento\Framework\Backup\Factory\TYPE_DB
const TYPE_DB
Definition:
Factory.php:32
Magento\Framework\Backup\Factory\__construct
__construct(ObjectManagerInterface $objectManager)
Definition:
Factory.php:64