| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function insertOrUpdate(string $table, array $rows, array $primary) |
||
| 15 | { |
||
| 16 | $values = []; |
||
| 17 | foreach ($rows as $set) { |
||
| 18 | $values[] = "(" . implode(", ", $set) . ")"; |
||
| 19 | } |
||
| 20 | $result = $this->driver->execute("REPLACE INTO " . $this->driver->table($table) . |
||
| 21 | " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values)); |
||
| 22 | return $result == true; |
||
| 23 | } |
||
| 64 |