Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #5656 toValue( boolean_column ) not works
Submitted: 2005-10-11 14:29 UTC
From: xia at silvia dot com Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 4.3.11 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-11 14:29 UTC] xia at silvia dot com
Description: ------------ toValue() method with boolean column name does not work. First, const "DB_DATAOBJECT_BOOLEAN" used in switch() statement, but declared const is "DB_DATAOBJECT_BOOL". And, method returns $cols[$col] but $this->$col. This part of method should be as: ---- case ($cols[$col] & DB_DATAOBJECT_BOOL): if ($cols[$col] & DB_DATAOBJECT_STR) { // it's a 't'/'f' ! return ($this->$col == 't'); } return (bool) $this->$col; ----

Comments

 [2005-10-12 02:08 UTC] alan_k
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2005-10-12 02:21 UTC] xia at silvia dot com
Thanks, but, there were another bug. Method returns $cols[$col] now, but should return (bool)$this->$col or ($this->$col == 't'). Please fix it. And, I found one more, 'default' returns $this->col, but it should return $this->$col. Should I report it as new bug?
 [2005-10-12 03:58 UTC] alan_k
should be fixed now.