Нет описания

Process.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*******************************************************************************
  3. * Copyright (c) 2019, Code Atlantic LLC
  4. ******************************************************************************/
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. /**
  9. * Base interface for registering a batch process.
  10. *
  11. * @since 1.7.0
  12. */
  13. interface PUM_Interface_Batch_Process {
  14. /**
  15. * Determines if the current user can perform the current batch process.
  16. *
  17. * @return bool True if the current user has the needed capability, otherwise false.
  18. */
  19. public function can_process();
  20. /**
  21. * Processes a single step (batch).
  22. *
  23. * @return int|string|WP_Error Next step number, 'done', or a WP_Error object.
  24. */
  25. public function process_step();
  26. /**
  27. * Retrieves the calculated completion percentage.
  28. *
  29. * @return int Percentage completed.
  30. */
  31. public function get_percentage_complete();
  32. /**
  33. * Retrieves a message based on the given message code.
  34. *
  35. * @param string $code Message code.
  36. *
  37. * @return string Message.
  38. */
  39. public function get_message( $code );
  40. /**
  41. * Defines logic to execute once batch processing is complete.
  42. */
  43. public function finish();
  44. }