For example I have a Store model with fields fromH and toH, I want to retrieve stores from database that are open in given hour (@t).
SQL query would look like this
select *
from store
where
( fromH < toH and @t between fromH and toH ) or
( fromH > toH and
(@t between fromH and 24 OR
(@t between 1 and toH )
)
How do I implement this query in cakephp, how would the conditions array look? I want to do it cake style.