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