>
> Hello,
>
> Handling priority of WHERE clause statements with the current API can be
> disgraceful.
> What if an easier method was to use the Reverse Polish Notation to handle
> it :
>
> // a > min and a < max
> ->where('a > ?', $min)
> ->where('a < ?', $max)
> ->and()
>
> // a = 42 or (a > min and a < max)
> ->where('a > ?', $min)
> ->where('a < ?', $max)
> ->and()
> ->where('a = ?', 42)
> ->or()
>
> // it can also be written :
> ->where('a = ?', 42)
> ->where('a > ?', $min)
> ->where('a < ?', $max)
> ->and()
> ->or()
>
> RPN is an "elegant" way of managing priority in general, and easy to
> implement with a stack.
>
> Marc Dassonneville
>
>
Sounds like a good thing to me, but I would definitely not change
Zend_Db_Select, you'd be better creating a subclass... but yeah the syntax
sounds right.
--
View this message in context: http://www.nabble.com/Zend_Db_Select%2C-WHERE-clause-API-tp22498322p22501219.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论