PatchInterface.php 778 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Setup\Patch;
  7. /**
  8. * This interface describe script, that is presented by atomic operations for data and schema
  9. */
  10. interface PatchInterface extends DependentPatchInterface
  11. {
  12. /**
  13. * Get aliases (previous names) for the patch.
  14. *
  15. * @return string[]
  16. */
  17. public function getAliases();
  18. /**
  19. * Run code inside patch
  20. * If code fails, patch must be reverted, in case when we are speaking about schema - than under revert
  21. * means run PatchInterface::revert()
  22. *
  23. * If we speak about data, under revert means: $transaction->rollback()
  24. *
  25. * @return $this
  26. */
  27. public function apply();
  28. }