Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions
RevertableDataPatch Class Reference
Inheritance diagram for RevertableDataPatch:
DataPatchInterface PatchRevertableInterface PatchInterface DependentPatchInterface

Public Member Functions

 getAliases ()
 
 apply ()
 
 revert ()
 

Static Public Member Functions

static getDependencies ()
 

Detailed Description

Definition at line 103 of file data_patch_classes.php.

Member Function Documentation

◆ apply()

apply ( )

{Run code inside patch If code fails, patch must be reverted, in case when we are speaking about schema - than under revert means run PatchInterface::revert()If we speak about data, under revert means: $transaction->rollback()

Returns
$this
}

Implements PatchInterface.

Definition at line 126 of file data_patch_classes.php.

127  {
128  }

◆ getAliases()

getAliases ( )

{Get aliases (previous names) for the patch.

Returns
string[]
}

Implements PatchInterface.

Definition at line 118 of file data_patch_classes.php.

119  {
120  return [];
121  }

◆ getDependencies()

static getDependencies ( )
static

{Get array of patches that have to be executed prior to this.example of implementation:[ \Vendor_Name\Module_Name\Setup\Patch\Patch1::class, \Vendor_Name\Module_Name\Setup\Patch\Patch2::class ]

Returns
string[]
}

Implements DependentPatchInterface.

Definition at line 110 of file data_patch_classes.php.

111  {
112  return [];
113  }

◆ revert()

revert ( )

{Rollback all changes, done by this patch

Returns
void
}

Implements PatchRevertableInterface.

Definition at line 133 of file data_patch_classes.php.

134  {
135  }

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