123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\SalesRule\Setup\Patch\Data;
- use Magento\Framework\Setup\ModuleDataSetupInterface;
- use Magento\Framework\Setup\Patch\DataPatchInterface;
- use Magento\Framework\Setup\Patch\PatchVersionInterface;
- /**
- * Class PrepareRuleModelSerializedData
- *
- * @package Magento\SalesRule\Setup\Patch
- */
- class PrepareRuleModelSerializedData implements DataPatchInterface, PatchVersionInterface
- {
- /**
- * @var ModuleDataSetupInterface
- */
- private $moduleDataSetup;
- /**
- * PatchInitial constructor.
- * @param ModuleDataSetupInterface $moduleDataSetup
- */
- public function __construct(
- ModuleDataSetupInterface $moduleDataSetup
- ) {
- $this->moduleDataSetup = $moduleDataSetup;
- }
- /**
- * @inheritdoc
- */
- public function apply()
- {
- $installer = $this->moduleDataSetup->createMigrationSetup();
- $this->moduleDataSetup->startSetup();
- $installer->appendClassAliasReplace(
- 'salesrule',
- 'conditions_serialized',
- \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL,
- \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_SERIALIZED,
- ['rule_id']
- );
- $installer->appendClassAliasReplace(
- 'salesrule',
- 'actions_serialized',
- \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL,
- \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_SERIALIZED,
- ['rule_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 [];
- }
- }
|