diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:30:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:30:22 +0000 |
commit | 3094c54084a305de471e7a530468a5a3b3b34dc7 (patch) | |
tree | 0a5f62e9d1963d4f5715acefc2c8e6dad932eaaa /vendor/ipl/orm/src/Compat | |
parent | Adding debian version 0.13.1-1. (diff) | |
download | icinga-php-library-3094c54084a305de471e7a530468a5a3b3b34dc7.tar.xz icinga-php-library-3094c54084a305de471e7a530468a5a3b3b34dc7.zip |
Merging upstream version 0.13.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ipl/orm/src/Compat')
-rw-r--r-- | vendor/ipl/orm/src/Compat/FilterProcessor.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/ipl/orm/src/Compat/FilterProcessor.php b/vendor/ipl/orm/src/Compat/FilterProcessor.php index 7956898..361aabb 100644 --- a/vendor/ipl/orm/src/Compat/FilterProcessor.php +++ b/vendor/ipl/orm/src/Compat/FilterProcessor.php @@ -139,6 +139,13 @@ class FilterProcessor extends \ipl\Sql\Compat\FilterProcessor if (! $behaviorsApplied) { $rewrittenFilter = $subjectBehaviors->rewriteCondition($filter, $path . '.'); if ($rewrittenFilter !== null) { + if ( + $rewrittenFilter instanceof MetaDataProvider + && $rewrittenFilter->metaData()->get('forceResolved', false) + ) { + return $rewrittenFilter; + } + return $this->requireAndResolveFilterColumns($rewrittenFilter, $query, $forceOptimization) ?: $rewrittenFilter; } @@ -328,6 +335,12 @@ class FilterProcessor extends \ipl\Sql\Compat\FilterProcessor $subQuerySelect->having(["COUNT(DISTINCT $targetKeys) >= ?" => $count]); $subQuerySelect->groupBy(array_values($subQuerySelect->getColumns())); + + if ($negate) { + $subQuerySelect->where(array_map(function ($k) { + return $k . ' IS NOT NULL'; + }, array_values($subQuerySelect->getColumns()))); + } } // TODO: Qualification is only necessary since the `In` and `NotIn` conditions are ignored by |