Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | public function get_customers() { |
||
46 | global $wpdb; |
||
47 | |||
48 | $where = '1 = 1'; |
||
49 | |||
50 | if ( array_key_exists( 'user_id', $this->args ) ) { |
||
51 | $where .= $wpdb->prepare( ' AND mollie_customer_user.user_id = %d', $this->args['user_id'] ); |
||
52 | } |
||
53 | |||
54 | $query = " |
||
55 | SELECT |
||
56 | mollie_customer.mollie_id, |
||
57 | mollie_customer.test_mode |
||
58 | FROM |
||
59 | $wpdb->pronamic_pay_mollie_customer_users AS mollie_customer_user |
||
60 | INNER JOIN |
||
61 | $wpdb->pronamic_pay_mollie_customers AS mollie_customer |
||
62 | ON mollie_customer_user.customer_id = mollie_customer.id |
||
63 | WHERE |
||
64 | $where |
||
65 | ; |
||
66 | "; |
||
67 | |||
68 | return $wpdb->get_results( $query ); |
||
69 | } |
||
71 |