I have a function returning data based on the parameters passed. Basically, the queries change depending on the clauses.
if(1==$case)
return select()->from('db')->where('x',$something)->where('y','fixed')...
else if(2==$case)
return select()->from('db')->where('x','fixed')->where('y',$something)...
Is there a better way of doing this?
Also, is it possible to have such a clause
...->where('category',*)
'*' to be replaced by a value or something which equates to "any".