class-order-customers-report.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Order Customers Report Class - Specific implementation for order customers list report
  4. *
  5. * @package StudiouWCCustomReports
  6. */
  7. if (!defined('ABSPATH')) {
  8. exit;
  9. }
  10. class StudiouWC_Order_Customers_Report {
  11. private $db_manager;
  12. private $data;
  13. public function __construct($db_manager, $data) {
  14. $this->db_manager = $db_manager;
  15. $this->data = $data;
  16. }
  17. public function get_report_data() {
  18. return $this->db_manager->get_order_customers_list(
  19. $this->data->get_date_from(),
  20. $this->data->get_date_to(),
  21. $this->data->get_statuses(),
  22. $this->data->get_per_page(),
  23. $this->data->get_paged(),
  24. $this->data->get_orderby(),
  25. $this->data->get_order()
  26. );
  27. }
  28. public function get_total_items() {
  29. return $this->db_manager->get_order_customers_total_items(
  30. $this->data->get_date_from(),
  31. $this->data->get_date_to(),
  32. $this->data->get_statuses()
  33. );
  34. }
  35. public function get_export_data() {
  36. return $this->db_manager->get_order_customers_list(
  37. $this->data->get_date_from(),
  38. $this->data->get_date_to(),
  39. $this->data->get_statuses(),
  40. 999999,
  41. 1,
  42. $this->data->get_orderby(),
  43. $this->data->get_order()
  44. );
  45. }
  46. }