Skip to content

Commit

Permalink
Update DocumentRepository.php
Browse files Browse the repository at this point in the history
Added $repository->findBy(array('field' => array('val1', 'val2'))) support via ->orX() method
  • Loading branch information
vudaltsov committed Jan 11, 2016
1 parent a35a0a9 commit af346bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Doctrine/ODM/PHPCR/DocumentRepository.php
Expand Up @@ -168,7 +168,14 @@ public function findBy(array $criteria, array $orderBy = null, $limit = null, $o
$where = $qb->andWhere();
}

$this->constraintField($where, $field, $value, 'a');
if (!is_array($value)) {
$this->constraintField($where, $field, $value, 'a');
} else {
$where = $where->orX();
foreach ($value as $oneValue) {
$this->constraintField($where, $field, $oneValue, 'a');
}
}
}

return $qb->getQuery()->execute();
Expand Down

0 comments on commit af346bc

Please sign in to comment.