1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Widget\Setup\Patch\Data;
- use Magento\Framework\Setup\ModuleDataSetupInterface;
- use Magento\Framework\Setup\Patch\DataPatchInterface;
- use Magento\Framework\Setup\Patch\PatchVersionInterface;
- /**
- * Class UpgradeModelInstanceClassAliases
- * @package Magento\Widget\Setup\Patch
- */
- class UpgradeModelInstanceClassAliases implements DataPatchInterface, PatchVersionInterface
- {
- /**
- * @var ModuleDataSetupInterface
- */
- private $moduleDataSetup;
- /**
- * UpgradeModelInstanceClassAliases constructor.
- * @param ModuleDataSetupInterface $moduleDataSetup
- */
- public function __construct(
- \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
- ) {
- $this->moduleDataSetup = $moduleDataSetup;
- }
- /**
- * {@inheritdoc}
- */
- public function apply()
- {
- $installer = $this->moduleDataSetup->createMigrationSetup();
- $this->moduleDataSetup->startSetup();
- $installer->appendClassAliasReplace(
- 'widget_instance',
- 'instance_type',
- \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK,
- \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN,
- ['instance_id']
- );
- $installer->appendClassAliasReplace(
- 'layout_update',
- 'xml',
- \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK,
- \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML,
- ['layout_update_id']
- );
- $installer->doUpdateClassAliases();
- $this->moduleDataSetup->endSetup();
- }
- /**
- * {@inheritdoc}
- */
- public static function getDependencies()
- {
- return [];
- }
- /**
- * {@inheritdoc}
- */
- public static function getVersion()
- {
- return '2.0.0';
- }
- /**
- * {@inheritdoc}
- */
- public function getAliases()
- {
- return [];
- }
- }
|