From 06e1b6259fc59ff741e8a7b547c58dc962fd8d94 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 6 Mar 2024 14:50:48 +0100 Subject: [PATCH] Reverted changes --- .../Pixie/QueryBuilder/Adapters/BaseAdapter.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php b/src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php index ae8e140..05d32bc 100644 --- a/src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php +++ b/src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php @@ -443,10 +443,10 @@ private function doInsert(array $statements, array $data, $type): array $keys[] = $key; if ($value instanceof Raw) { $values[] = (string)$value; - $bindings[] = (array)$value->getBindings(); + $bindings[] = $value->getBindings(); } else { $values[] = '?'; - $bindings[] = (array)$value; + $bindings[] = $value; } } @@ -458,8 +458,6 @@ private function doInsert(array $statements, array $data, $type): array '(' . $this->arrayStr($values, ', ', false) . ')', ]; - $bindings = array_merge(...$bindings); - if (isset($statements['onduplicate']) === true) { if (\count($statements['onduplicate']) < 1) { @@ -495,15 +493,13 @@ private function getUpdateStatement(array $data): array if ($value instanceof Raw) { $statements[] = $statement . $value; - $bindings[] = (array)$value->getBindings(); + $bindings += $value->getBindings(); } else { $statements[] = $statement . '?'; - $bindings[] = (array)$value; + $bindings[] = $value; } } - $bindings = array_merge(...$bindings); - $statement = trim($this->arrayStr($statements, ', ', false)); return [$statement, $bindings];