class-wc-importer-interface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * WooCommerce Importer Interface
  4. *
  5. * @package WooCommerce/Interface
  6. * @version 3.1.0
  7. */
  8. if ( ! defined( 'ABSPATH' ) ) {
  9. exit;
  10. }
  11. /**
  12. * WC_Importer_Interface class.
  13. */
  14. interface WC_Importer_Interface {
  15. /**
  16. * Process importation.
  17. * Returns an array with the imported and failed items.
  18. * 'imported' contains a list of IDs.
  19. * 'failed' contains a list of WP_Error objects.
  20. *
  21. * Example:
  22. * ['imported' => [], 'failed' => []]
  23. *
  24. * @return array
  25. */
  26. public function import();
  27. /**
  28. * Get file raw keys.
  29. *
  30. * CSV - Headers.
  31. * XML - Element names.
  32. * JSON - Keys
  33. *
  34. * @return array
  35. */
  36. public function get_raw_keys();
  37. /**
  38. * Get file mapped headers.
  39. *
  40. * @return array
  41. */
  42. public function get_mapped_keys();
  43. /**
  44. * Get raw data.
  45. *
  46. * @return array
  47. */
  48. public function get_raw_data();
  49. /**
  50. * Get parsed data.
  51. *
  52. * @return array
  53. */
  54. public function get_parsed_data();
  55. /**
  56. * Get file pointer position from the last read.
  57. *
  58. * @return int
  59. */
  60. public function get_file_position();
  61. /**
  62. * Get file pointer position as a percentage of file size.
  63. *
  64. * @return int
  65. */
  66. public function get_percent_complete();
  67. }