Home » Database » DB_DataObject » Bug #5656
toValue( boolean_column ) not works
Details
| 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 |
| Roadmaps | (Not assigned) |
Comments
[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;
----
[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?