class-wc-order-data-store-interface.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * Order Data Store Interface
  4. *
  5. * @version 3.0.0
  6. * @package WooCommerce/Interface
  7. */
  8. if ( ! defined( 'ABSPATH' ) ) {
  9. exit;
  10. }
  11. /**
  12. * WC Order Data Store Interface
  13. *
  14. * Functions that must be defined by order store classes.
  15. *
  16. * @version 3.0.0
  17. */
  18. interface WC_Order_Data_Store_Interface {
  19. /**
  20. * Get amount already refunded.
  21. *
  22. * @param WC_Order $order Order object.
  23. * @return string
  24. */
  25. public function get_total_refunded( $order );
  26. /**
  27. * Get the total tax refunded.
  28. *
  29. * @param WC_Order $order Order object.
  30. * @return float
  31. */
  32. public function get_total_tax_refunded( $order );
  33. /**
  34. * Get the total shipping refunded.
  35. *
  36. * @param WC_Order $order Order object.
  37. * @return float
  38. */
  39. public function get_total_shipping_refunded( $order );
  40. /**
  41. * Finds an Order ID based on an order key.
  42. *
  43. * @param string $order_key An order key has generated by.
  44. * @return int The ID of an order, or 0 if the order could not be found.
  45. */
  46. public function get_order_id_by_order_key( $order_key );
  47. /**
  48. * Return count of orders with a specific status.
  49. *
  50. * @param string $status Order status.
  51. * @return int
  52. */
  53. public function get_order_count( $status );
  54. /**
  55. * Get all orders matching the passed in args.
  56. *
  57. * @see wc_get_orders()
  58. * @param array $args Arguments.
  59. * @return array of orders
  60. */
  61. public function get_orders( $args = array() );
  62. /**
  63. * Get unpaid orders after a certain date,
  64. *
  65. * @param int $date timestamp.
  66. * @return array
  67. */
  68. public function get_unpaid_orders( $date );
  69. /**
  70. * Search order data for a term and return ids.
  71. *
  72. * @param string $term Term name.
  73. * @return array of ids
  74. */
  75. public function search_orders( $term );
  76. /**
  77. * Gets information about whether permissions were generated yet.
  78. *
  79. * @param WC_Order $order Order object.
  80. * @return bool
  81. */
  82. public function get_download_permissions_granted( $order );
  83. /**
  84. * Stores information about whether permissions were generated yet.
  85. *
  86. * @param WC_Order $order Order object.
  87. * @param bool $set If should set.
  88. */
  89. public function set_download_permissions_granted( $order, $set );
  90. /**
  91. * Gets information about whether sales were recorded.
  92. *
  93. * @param WC_Order $order Order object.
  94. * @return bool
  95. */
  96. public function get_recorded_sales( $order );
  97. /**
  98. * Stores information about whether sales were recorded.
  99. *
  100. * @param WC_Order $order Order object.
  101. * @param bool $set If should set.
  102. */
  103. public function set_recorded_sales( $order, $set );
  104. /**
  105. * Gets information about whether coupon counts were updated.
  106. *
  107. * @param WC_Order $order Order object.
  108. * @return bool
  109. */
  110. public function get_recorded_coupon_usage_counts( $order );
  111. /**
  112. * Stores information about whether coupon counts were updated.
  113. *
  114. * @param WC_Order $order Order object.
  115. * @param bool $set If should set.
  116. */
  117. public function set_recorded_coupon_usage_counts( $order, $set );
  118. /**
  119. * Get the order type based on Order ID.
  120. *
  121. * @param int $order_id Order ID.
  122. * @return string
  123. */
  124. public function get_order_type( $order_id );
  125. }