mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[QueryBuilder] Modify query based on variable value #5482
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @michal-lewandowski on GitHub (Mar 27, 2017).
Originally assigned to: @Ocramius on GitHub.
Hi, I'm using Symfony3 and I've prepared following query:
What should I do if I want to add if statement (if $year is not null, I want to add one more andWhere() method) while building query. I've tried this code:
And it didn't worked for me, I've got:
Regards :D
@michal-lewandowski commented on GitHub (Mar 27, 2017):
I found a soluting. I had to move getQuery() to $products