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

Public Member Functions

 getAliases ()
 
 apply ()
 

Static Public Member Functions

static getDependencies ()
 
static getVersion ()
 

Detailed Description

Definition at line 35 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 60 of file data_patch_classes.php.

61  {
62  return $this;
63  }

◆ getAliases()

getAliases ( )

{Get aliases (previous names) for the patch.

Returns
string[]
}

Implements PatchInterface.

Definition at line 52 of file data_patch_classes.php.

53  {
54  return [];
55  }

◆ 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 42 of file data_patch_classes.php.

43  {
44  return [
45  OtherDataPatch::class,
46  ];
47  }

◆ getVersion()

static getVersion ( )
static

{This version associate patch with Magento setup version. For example, if Magento current setup version is 2.0.3 and patch version is 2.0.2 than this patch will be added to registry, but will not be applied, because it is already applied by old mechanism of UpgradeData.php script

Returns
string
Deprecated:
since appearance, required for backward compatibility
}

Implements PatchVersionInterface.

Definition at line 68 of file data_patch_classes.php.

69  {
70  return '2.0.0';
71  }

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