BatchProcess.php 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Abstracts_Batch_Process
  4. */
  5. abstract class NF_Abstracts_BatchProcess
  6. {
  7. /**
  8. * Constructor
  9. */
  10. public function __construct( $data = array() )
  11. {
  12. //Bail if we aren't in the admin.
  13. if ( ! is_admin() )
  14. return false;
  15. }
  16. /**
  17. * Function to loop over the batch.
  18. */
  19. public function process()
  20. {
  21. /**
  22. * This function intentionlly left empty.
  23. */
  24. }
  25. /**
  26. * Function to run any setup steps necessary to begin processing.
  27. */
  28. public function startup()
  29. {
  30. /**
  31. * This function intentionally left empty.
  32. */
  33. }
  34. /**
  35. * Function to cleanup any lingering temporary elements of a batch process after completion.
  36. */
  37. public function cleanup()
  38. {
  39. /**
  40. * This function intentionally left empty.
  41. */
  42. }
  43. }