I have written a calendar plugin for osTicket. v 1.15.1 and I am currently trying to fetch Objects from the database with somewhat complex Queries.
My Model has the fields shift, interval and year. I need to fetch all objects that have either
- shift = x AND interval < y
- OR shift = x AND interval = y AND year < currentYear
- OR shift = x AND interval > y AMD year < lastYear
I am able to create either of these queries, but I can not combine them (with MyModel::objects()->filter()). It seems that when using Q::ANY I can only "or" all of the given array values. How can I implement that filter with the filter() method ?