Skip to content

Commit

Permalink
Merge pull request #160 from skipperbent/v4-development
Browse files Browse the repository at this point in the history
Reverted changes
  • Loading branch information
skipperbent authored Mar 6, 2024
2 parents c242fea + 06e1b62 commit 1bbfcdc
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 1bbfcdc

Please sign in to comment.