Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpgradeModelInstanceClassAliases.php
Go to the documentation of this file.
1 <?php
8 
12 
18 {
22  private $moduleDataSetup;
23 
28  public function __construct(
29  \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
30  ) {
31  $this->moduleDataSetup = $moduleDataSetup;
32  }
33 
37  public function apply()
38  {
39  $installer = $this->moduleDataSetup->createMigrationSetup();
40  $this->moduleDataSetup->startSetup();
41 
42  $installer->appendClassAliasReplace(
43  'widget_instance',
44  'instance_type',
45  \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK,
46  \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN,
47  ['instance_id']
48  );
49  $installer->appendClassAliasReplace(
50  'layout_update',
51  'xml',
52  \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK,
53  \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML,
54  ['layout_update_id']
55  );
56  $installer->doUpdateClassAliases();
57  $this->moduleDataSetup->endSetup();
58  }
59 
63  public static function getDependencies()
64  {
65  return [];
66  }
67 
71  public static function getVersion()
72  {
73  return '2.0.0';
74  }
75 
79  public function getAliases()
80  {
81  return [];
82  }
83 }
__construct(\Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup)