Skip to content

Commit

Permalink
Merge pull request #4 from curiosity26/develop
Browse files Browse the repository at this point in the history
Criteria must be an expression and not an array
  • Loading branch information
curiosity26 authored Nov 13, 2018
2 parents b02fd38 + 78ea8b0 commit 6612967
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Helper/AclHelperAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ public function findBy(
;

if (!empty($criteria)) {
$predicates = [];
$predicates = $builder->expr()->andX();
foreach ($criteria as $field => $criterion) {
$predicates[] = is_array($criterion)
$predicates->add(
is_array($criterion)
? $builder->expr()->in("e,$field", ":$field")
: $builder->expr()->eq("e.$field", ":$field");
: $builder->expr()->eq("e.$field", ":$field")
);
$builder->setParameter(":$field", $criterion);
}

Expand Down

0 comments on commit 6612967

Please sign in to comment.