UpdateAutocompleteOnStorefrontConfigPath.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Setup\Patch\Data;
  7. use Magento\Framework\App\ResourceConnection;
  8. use Magento\Framework\Setup\ModuleDataSetupInterface;
  9. use Magento\Framework\Setup\Patch\DataPatchInterface;
  10. use Magento\Framework\Setup\Patch\PatchVersionInterface;
  11. /**
  12. * Class UpdateAutocompleteOnStorefrontCOnfigPath
  13. * @package Magento\Customer\Setup\Patch
  14. */
  15. class UpdateAutocompleteOnStorefrontConfigPath implements DataPatchInterface, PatchVersionInterface
  16. {
  17. /**
  18. * @var ModuleDataSetupInterface
  19. */
  20. private $moduleDataSetup;
  21. /**
  22. * UpdateAutocompleteOnStorefrontCOnfigPath constructor.
  23. * @param ModuleDataSetupInterface $moduleDataSetup
  24. */
  25. public function __construct(
  26. ModuleDataSetupInterface $moduleDataSetup
  27. ) {
  28. $this->moduleDataSetup = $moduleDataSetup;
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function apply()
  34. {
  35. $this->moduleDataSetup->getConnection()->update(
  36. $this->moduleDataSetup->getTable('core_config_data'),
  37. ['path' => \Magento\Customer\Model\Form::XML_PATH_ENABLE_AUTOCOMPLETE],
  38. ['path = ?' => 'general/restriction/autocomplete_on_storefront']
  39. );
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public static function getDependencies()
  45. {
  46. return [
  47. AddSecurityTrackingAttributes::class,
  48. ];
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public static function getVersion()
  54. {
  55. return '2.0.8';
  56. }
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function getAliases()
  61. {
  62. return [];
  63. }
  64. }