|
10 | 10 | use Yiisoft\Db\Exception\NotSupportedException; |
11 | 11 | use Yiisoft\Db\Expression\ExpressionInterface; |
12 | 12 | use Yiisoft\Db\QueryBuilder\Condition\In; |
| 13 | +use Yiisoft\Db\QueryBuilder\Condition\NotIn; |
13 | 14 |
|
14 | 15 | use function array_slice; |
15 | 16 | use function array_unshift; |
16 | 17 | use function count; |
17 | 18 | use function is_array; |
18 | 19 |
|
19 | 20 | /** |
20 | | - * Build an object of {@see In} into SQL expressions for Oracle Server. |
| 21 | + * Build an object of {@see In} or {@see NotIn} into SQL expressions for Oracle Server. |
21 | 22 | */ |
22 | 23 | final class InBuilder extends \Yiisoft\Db\QueryBuilder\Condition\Builder\InBuilder |
23 | 24 | { |
24 | 25 | /** |
25 | 26 | * The Method builds the raw SQL from the $expression that won't be additionally escaped or quoted. |
26 | 27 | * |
27 | | - * @param In $expression The expression to build. |
| 28 | + * @param In|NotIn $expression The expression to build. |
28 | 29 | * @param array $params The binding parameters. |
29 | 30 | * |
30 | 31 | * @throws Exception |
@@ -55,9 +56,12 @@ public function build(ExpressionInterface $expression, array &$params = []): str |
55 | 56 | * |
56 | 57 | * @return string|null `null` when split isn't required. Otherwise - built SQL condition. |
57 | 58 | */ |
58 | | - protected function splitCondition(In $condition, array &$params): string|null |
| 59 | + protected function splitCondition(In|NotIn $condition, array &$params): string|null |
59 | 60 | { |
60 | | - $operator = $condition->operator; |
| 61 | + $operator = match ($condition::class) { |
| 62 | + In::class => 'IN', |
| 63 | + NotIn::class => 'NOT IN', |
| 64 | + }; |
61 | 65 | $values = $condition->values; |
62 | 66 | $column = $condition->column; |
63 | 67 |
|
|
0 commit comments