class-wc-customer-download-data-store-interface.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Customer Download Data Store Interface
  4. *
  5. * @version 3.0.0
  6. * @package WooCommerce/Interface
  7. */
  8. if ( ! defined( 'ABSPATH' ) ) {
  9. exit;
  10. }
  11. /**
  12. * WC Customer Download Data Store Interface.
  13. *
  14. * @version 3.0.0
  15. */
  16. interface WC_Customer_Download_Data_Store_Interface {
  17. /**
  18. * Method to delete a download permission from the database by ID.
  19. *
  20. * @param int $id Download Permission ID.
  21. */
  22. public function delete_by_id( $id );
  23. /**
  24. * Method to delete a download permission from the database by order ID.
  25. *
  26. * @param int $id Order ID.
  27. */
  28. public function delete_by_order_id( $id );
  29. /**
  30. * Method to delete a download permission from the database by download ID.
  31. *
  32. * @param int $id Download ID.
  33. */
  34. public function delete_by_download_id( $id );
  35. /**
  36. * Get array of download ids by specified args.
  37. *
  38. * @param array $args Arguments.
  39. * @return array of WC_Customer_Download
  40. */
  41. public function get_downloads( $args = array() );
  42. /**
  43. * Update download ids if the hash changes.
  44. *
  45. * @param int $product_id Product ID.
  46. * @param string $old_id Old ID.
  47. * @param string $new_id New ID.
  48. */
  49. public function update_download_id( $product_id, $old_id, $new_id );
  50. /**
  51. * Get a customers downloads.
  52. *
  53. * @param int $customer_id Customer ID.
  54. * @return array
  55. */
  56. public function get_downloads_for_customer( $customer_id );
  57. /**
  58. * Update user prop for downloads based on order id.
  59. *
  60. * @param int $order_id Order ID.
  61. * @param int $customer_id Customer ID.
  62. * @param string $email Email Address.
  63. */
  64. public function update_user_by_order_id( $order_id, $customer_id, $email );
  65. }