05.
Filtering / Searching
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
3 Comments
Hello,
it is possible to do a course on elasticsearch symfony
have a good day
Hi, I was wondering for a use case were there will be 10+ filters a user will be able to search by. The url could be something
myurl.com?name=test&capacit...
Instead of writing out 10+ andWhere() statements i was wondering it there a way to pass a variable into the andWhere() statement. Something like andWhere('$filters LIKE :filter') however i have trouble as the single quotes are needed as part of the query syntax and ive tried concatenating the varible to the query but that didn't work either.
Wondering if you have any suggestions ?
Cheers
Claire
So it is ok to have logic in repositories? Like if ($filter) { add some filtering } I was thinking about it long time and did not know the answer. From the testability perspective - we do not unit test repositories, and so less logic would be better. But we can still test them with the tests like you write - which call whole api endpoint.
"Houston: no signs of life"
Start the conversation!