Нет описания

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

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