From e938e30fdc33a18520875591ded7e97ef3b55d1d Mon Sep 17 00:00:00 2001 From: GGedde Date: Fri, 7 Apr 2023 18:17:43 -0700 Subject: [PATCH] Update to all Raw in the IN and NOT IN statements. This is working for me, but I am not too familiar with the map system so please review this thoroughly. This resolves issue #1079 --- src/Medoo.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Medoo.php b/src/Medoo.php index dcf6b260..869478d5 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -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) . ')'; @@ -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) . ')';