PHQL - Multiple BetweenWhere clauses

Hello. In the API help ( http://docs.phalconphp.com/en/latest/api/Phalcon%5Mvc%5Model%5Query%5Builder.html ) i can see that the query builder has the functions where , andWhere , orWhere . The first add the "first" where to the query. The second add a clause "and where" and the third add a clause "or where".

So far, so good.

But looking at the "between where", i can only find betweenWhere and notBetweenWhere . So, my question is: Is there no andBetweenWhere or orBetweenWhere and to execute such query i would have to do something like andWhere("column BETWEEN :min: AND :max:") ?

Thank you all very much



6.3k
edited Aug '14

Well, it seems i don't have any other option (yer). I am using ->andWhere("model.column BETWEEN :minvalue: AND :maxvalue:")



83.4k

You can use betweenWhere several times to add more than one between to the query



6.3k

Great. But how do i add the and and or because sometimes i might want to find results whose column1 is between two values AND column2 between two values and some other times i might want to find results where column1 is between two values OR between two other values.

If i use betweenWhere several times would it be an implicit andBetweenWhere ?