Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Factory Class Reference

Public Member Functions

 __construct (ObjectManagerInterface $objectManager)
 
 create ($type)
 

Data Fields

const TYPE_DB = 'db'
 
const TYPE_FILESYSTEM = 'filesystem'
 
const TYPE_SYSTEM_SNAPSHOT = 'snapshot'
 
const TYPE_MEDIA = 'media'
 
const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia'
 

Protected Attributes

 $_allowedTypes
 

Detailed Description

@api

Since
100.0.2

Definition at line 20 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ObjectManagerInterface  $objectManager)
Parameters
ObjectManagerInterface$objectManager

Definition at line 64 of file Factory.php.

65  {
66  $this->_objectManager = $objectManager;
67  $this->_allowedTypes = [
73  ];
74  }
$objectManager
Definition: bootstrap.php:17

Member Function Documentation

◆ create()

create (   $type)

Create new backup instance

Parameters
string$type
Returns
BackupInterface
Exceptions
LocalizedExceptionGet mapper instance
Parameters
string$type
Returns
\Magento\Config\Model\Config\Structure\MapperInterface
Exceptions

Definition at line 83 of file Factory.php.

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  }
$type
Definition: item.phtml:13
$_option $_optionId $class
Definition: date.phtml:13

Field Documentation

◆ $_allowedTypes

$_allowedTypes
protected

Definition at line 59 of file Factory.php.

◆ TYPE_DB

const TYPE_DB = 'db'

Backup type constant for database backup

Definition at line 32 of file Factory.php.

◆ TYPE_FILESYSTEM

const TYPE_FILESYSTEM = 'filesystem'

Backup type constant for filesystem backup

Definition at line 37 of file Factory.php.

◆ TYPE_MEDIA

const TYPE_MEDIA = 'media'

Backup type constant for media and database backup

Definition at line 47 of file Factory.php.

◆ TYPE_SNAPSHOT_WITHOUT_MEDIA

const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia'

Backup type constant for full system backup excluding media folder

Definition at line 52 of file Factory.php.

◆ TYPE_SYSTEM_SNAPSHOT

const TYPE_SYSTEM_SNAPSHOT = 'snapshot'

Backup type constant for full system backup(database + filesystem)

Definition at line 42 of file Factory.php.


The documentation for this class was generated from the following file: