ClearSampleDataState.php 1.5 KB

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