Skip to content

Commit

Permalink
Update to all Raw in the IN and NOT IN statements.
Browse files Browse the repository at this point in the history
This is working for me, but I am not too familiar with the map system so please review this thoroughly.
This resolves issue catfan#1079
  • Loading branch information
ggedde authored Apr 8, 2023
1 parent b49a620 commit e938e30
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/Medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,13 @@ protected function dataImplode(array $data, array &$map, string $conjunctor): st
$placeholders = [];

foreach ($value as $index => $item) {
$stackKey = $mapKey . $index . '_i';
$placeholders[] = $stackKey;
$map[$stackKey] = $this->typeMap($item, gettype($item));
if ($this->isRaw($item)) {
$placeholders[] = $this->buildRaw($item, $map);
} else {
$stackKey = $mapKey . $index . '_i';
$placeholders[] = $stackKey;
$map[$stackKey] = $this->typeMap($item, gettype($item));
}
}

$stack[] = $column . ' NOT IN (' . implode(', ', $placeholders) . ')';
Expand Down Expand Up @@ -984,10 +988,13 @@ protected function dataImplode(array $data, array &$map, string $conjunctor): st
$placeholders = [];

foreach ($value as $index => $item) {
$stackKey = $mapKey . $index . '_i';

$placeholders[] = $stackKey;
$map[$stackKey] = $this->typeMap($item, gettype($item));
if ($this->isRaw($item)) {
$placeholders[] = $this->buildRaw($item, $map);
} else {
$stackKey = $mapKey . $index . '_i';
$placeholders[] = $stackKey;
$map[$stackKey] = $this->typeMap($item, gettype($item));
}
}

$stack[] = $column . ' IN (' . implode(', ', $placeholders) . ')';
Expand Down

0 comments on commit e938e30

Please sign in to comment.