Skip to content

Commit

Permalink
[BUGFIX] Find events by category equals to category
Browse files Browse the repository at this point in the history
Relates: #90
  • Loading branch information
extcode committed Aug 30, 2024
1 parent 9e0007e commit 0fa29cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Domain/Repository/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
}

Expand Down

0 comments on commit 0fa29cd

Please sign in to comment.