diff --git a/src/Compat/FilterProcessor.php b/src/Compat/FilterProcessor.php index b6c9bdc..f6c51ac 100644 --- a/src/Compat/FilterProcessor.php +++ b/src/Compat/FilterProcessor.php @@ -76,15 +76,17 @@ public static function assemblePredicate(Filter\Condition $filter) ($filter instanceof Filter\Equal || $filter instanceof Filter\Unequal) && strpos($expression, '*') !== false ) { - if ($expression === '*') { - return ["$column IS " . ($filter instanceof Filter\Equal ? 'NOT ' : '') . 'NULL']; - } elseif ($filter instanceof Filter\Unequal) { + if ($filter instanceof Filter\Unequal) { return ["($column NOT LIKE ? OR $column IS NULL)" => str_replace('*', '%', $expression)]; } else { return ["$column LIKE ?" => str_replace('*', '%', $expression)]; } } elseif ($filter instanceof Filter\Unequal) { return ["($column != ? OR $column IS NULL)" => $expression]; + } elseif ($filter instanceof Filter\HasNotValue) { + return ["$column IS NULL"]; + } elseif ($filter instanceof Filter\HasValue) { + return ["$column IS NOT NULL"]; } else { if ($filter instanceof Filter\Equal) { $operator = '=';