| @@ 504-516 (lines=13) @@ | ||
| 501 | if ( ! empty( $conditions ) ) { // get multiple but with a limitation. |
|
| 502 | $mappings = array(); |
|
| 503 | ||
| 504 | if ( ! empty( $conditions ) ) { |
|
| 505 | $where = ' WHERE '; |
|
| 506 | $i = 0; |
|
| 507 | foreach ( $conditions as $key => $value ) { |
|
| 508 | $i++; |
|
| 509 | if ( $i > 1 ) { |
|
| 510 | $where .= ' AND '; |
|
| 511 | } |
|
| 512 | $where .= '`' . $key . '` = "' . $value . '"'; |
|
| 513 | } |
|
| 514 | } else { |
|
| 515 | $where = ''; |
|
| 516 | } |
|
| 517 | ||
| 518 | $mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . $order, ARRAY_A ); |
|
| 519 | } else { // get all of the mappings. ALL THE MAPPINGS. |
|
| @@ 542-554 (lines=13) @@ | ||
| 539 | if ( ! empty( $conditions ) ) { // get multiple but with a limitation. |
|
| 540 | $mappings = array(); |
|
| 541 | ||
| 542 | if ( ! empty( $conditions ) ) { |
|
| 543 | $where = ' WHERE '; |
|
| 544 | $i = 0; |
|
| 545 | foreach ( $conditions as $key => $value ) { |
|
| 546 | $i++; |
|
| 547 | if ( $i > 1 ) { |
|
| 548 | $where .= ' AND '; |
|
| 549 | } |
|
| 550 | $where .= '`' . $key . '` = "' . $value . '"'; |
|
| 551 | } |
|
| 552 | } else { |
|
| 553 | $where = ''; |
|
| 554 | } |
|
| 555 | ||
| 556 | $mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . $order, ARRAY_A ); |
|
| 557 | if ( ! empty( $mappings ) && 1 === $this->wpdb->num_rows ) { |
|