ZF-10589: Zend_Db_Select::having() and Zend_Db_Select::orHaving() with empty "$value" param ("0" or an "empty string")
Description
Hi All,
Ticket #10000 on the bug tracker has added a functionality and was committed on release r22850.
It changes Zend_Db_Select::having() method and Zend_Db_Select::orHaving() method in Zend_Db_Select to allow us to pass the optional second parameter which way the $value should be quoted.
The patch was :
- if (func_num_args()> 1) {
- $val = func_get_arg(1);
- $cond = $this->_adapter->quoteInto($cond, $val);
- if ($value) {
- $cond = $this->_adapter->quoteInto($cond, $value, $type); }
My problem is that i can't pass a value which is considered as false (0, an empty string) in the statement. So i can't do :
$select->having("foo = ?", 0);
or
$select->orHaving("foo = ?", 0);
Comments
Posted by Marc Hodgins (mjh_ca) on 2010-10-24T17:09:48.000+0000
Patch with unit test attached.
Posted by Ralph Schindler (ralph) on 2010-10-25T13:15:48.000+0000
Fixed in r23236 in trunk and r23237 in release branch 1.11