Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine: IN-Operator in entity-repository's findBy?

I want to make a findBy in doctrine with the IN-Operator, like in SQL:

...WHERE column_name IN (value1,value2,...);

Is it possible to do this in the criteria array of the entity-repository's findBy?

this->entityRepository->findBy($criteria, $orderBy, $limit, $offset);

Or must I do this with DQL?

like image 582
Zwen2012 Avatar asked Feb 24 '15 10:02

Zwen2012


1 Answers

Yes, you can!

$repository->findBy(['column_name' => ['value1', 'value2', '...']]);

like image 136
Danizord Avatar answered Sep 21 '22 00:09

Danizord