OperationInterface.php 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Setup\Declaration\Schema;
  7. use Magento\Framework\Setup\Declaration\Schema\Db\Statement;
  8. /**
  9. * Schema operation interface.
  10. */
  11. interface OperationInterface
  12. {
  13. /**
  14. * Retrieve operation identifier key.
  15. *
  16. * @return string
  17. */
  18. public function getOperationName();
  19. /**
  20. * Is operation destructive flag.
  21. *
  22. * Destructive operations can make system unstable.
  23. *
  24. * For example, if operation is destructive it can remove table or column created not with
  25. * declarative schema (for example with old migration script).
  26. *
  27. * @return bool
  28. */
  29. public function isOperationDestructive();
  30. /**
  31. * Apply change of any type.
  32. *
  33. * @param ElementHistory $elementHistory
  34. * @return Statement[]
  35. */
  36. public function doOperation(ElementHistory $elementHistory);
  37. }