From 0fa29cdc44baf68397cef64b30ad1c2a7b5221ae Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Fri, 30 Aug 2024 23:13:08 +0200 Subject: [PATCH] [BUGFIX] Find events by category equals to category Relates: #90 --- Classes/Domain/Repository/EventRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php index 68f197e..de4747a 100644 --- a/Classes/Domain/Repository/EventRepository.php +++ b/Classes/Domain/Repository/EventRepository.php @@ -35,15 +35,15 @@ public function findDemanded(EventDemand $demand): QueryResultInterface if (!empty($demand->getCategories())) { $categoryConstraints = []; foreach ($demand->getCategories() as $category) { - $categoryConstraints[] = $query->contains('category', $category); + $categoryConstraints[] = $query->equals('category', $category); $categoryConstraints[] = $query->contains('categories', $category); } - $constraints = $query->logicalOr($categoryConstraints); + $constraints[] = $query->logicalOr(...array_values($categoryConstraints)); } if (!empty($constraints)) { $query->matching( - $query->logicalAnd($constraints) + $query->logicalAnd(...array_values($constraints)) ); }