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];