UpdateClassAliases.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Config\Setup\Patch\Data;
  7. use Magento\Framework\Module\Setup\Migration;
  8. use Magento\Framework\Setup\Patch\DataPatchInterface;
  9. use Magento\Framework\Setup\Patch\PatchVersionInterface;
  10. /**
  11. * Class UpdateClassAliases
  12. * @package Magento\Config\Setup\Patch
  13. */
  14. class UpdateClassAliases implements DataPatchInterface, PatchVersionInterface
  15. {
  16. /**
  17. * @var \Magento\Framework\Setup\ModuleDataSetupInterface
  18. */
  19. private $moduleDataSetup;
  20. /**
  21. * UpdateClassAliases constructor.
  22. * @param \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
  23. */
  24. public function __construct(
  25. \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
  26. ) {
  27. $this->moduleDataSetup = $moduleDataSetup;
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function apply()
  33. {
  34. $installer = $this->moduleDataSetup->createMigrationSetup();
  35. $this->moduleDataSetup->startSetup();
  36. $installer->appendClassAliasReplace(
  37. 'core_config_data',
  38. 'value',
  39. Migration::ENTITY_TYPE_MODEL,
  40. Migration::FIELD_CONTENT_TYPE_PLAIN,
  41. ['config_id']
  42. );
  43. $installer->doUpdateClassAliases();
  44. $this->moduleDataSetup->endSetup();
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public static function getDependencies()
  50. {
  51. return [];
  52. }
  53. /**
  54. * {@inheritdoc}
  55. */
  56. public static function getVersion()
  57. {
  58. return '2.0.0';
  59. }
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public function getAliases()
  64. {
  65. return [];
  66. }
  67. }